Re: Properties, what are they for? Wigets writing doubts.



Alexandre wrote:
  I'm beginning in widget's writing, and I want to know what is the purpose of the
  widgets properties. Because, when I look at the gtk widgets, they  have a lot of
  properties, but this properties can be changed with the gtk_name_set.. functions
  too..  Like the frame, is has a "label" property to change it's label, but it can
  be done with the gtk_frame_set_label (or anything like it), so, why use properties? 

They are mostly for bindings and automated builders (Glade) use.  If you never use
them, don't define them.  I think it is pointless to write lots of code you never
use just for `completeness'.  On the other hand, properties can be quite useful.  If
you use standard ones, you should probably define properties in your own widgets too.

(Somebody suggested here that accesor methods are just wrappers over properties.
If you look in the sourcecode, you can find that it is actually the way round,
property get/set functions use accesory methods...)

  One other thing, I've readed that if I want to make a widget with a child, this
  has to be a container (GtkContainer), so, I have a widget, it's a x-y plotting
  widget, and I have other widget, a scale. I want that the plotting wigdget has
  two childs (2 scale widgets) to be it's x and y axis. So, it's better if the
  plotting widgets has a GtkContainer as parent? Or other widget else?    

I don't really understand this question...

Paul



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]