RE: PROPOSAL: GTK_WIDGET_COMPOSITE_CHILD flag




> > So how would a user add widgets to something like a notebook tab?
>
> hm, what about implementing the above mentioned change, and then
> offering the user to drop widgets into the property editor, onto
> the tab_label or menu_label arguments? (we could also, instead of
> modifying those types from string to widget, offer widget type arguments,
> named GtkNotebook::tab_widget and GtkNotebook::menu_widget, that way the
> user is still able to simply specify strings if so desired, or provide
> real widgets for more advanced layouts. this would also be more consistent
> with the GtkButton behaviour, where you can either use GtkButton::label or
> GtkContainer::child. btw, the automatic labels need to be flagged as
> composite children of course).

I don't think this would work (using GTK_TYPE_WIDGET arguments in the
property
editor). If, for example, you wanted to add a pixmap to a notebook tab, you
drag the pixmap to the GtkNotebook::tab_widget arg in the property editor.
But
then how do you then set the properties of the pixmap? Another property
editor
to edit the properties of a widget on the first one??

If you use the GtkNotebook::tab_widget properties with GTK_TYPE_WIDGET, the
code
generation is also more complicated, since you have to make sure you output
code
to create the tab label and menu item before adding them to the notebook
page via
the child args. And if foreach() iterates over the tabs and menu items as
well,
you have to be careful that you don't output code for them twice.

I think adding the tabs and menu labels to the notebook with something like
a
'child_type' arg is better. Of course, since GtkNotebook is a standard
widget,
we can add special code to make it as simple as possible for the user. For
example, if a new notebook page is created, we can create default tab labels
and menu labels and let the user edit them. I think it does make code
generation much easier (it would be practically the same as the way Glade
does
it now, but with Args).

Damon




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