RE: PROPOSAL: GTK_WIDGET_COMPOSITE_CHILD flag



On Wed, 26 Aug 1998, Damon Chaplin wrote:

> 
> > > 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??

well, once it's added to the notebook, you simly update the widget tree,
and then provide generic access to the pixmap as well as to all other widgets.

> 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.

GUI builders have to implement special handling for widgets that they are going
to pass through the arg system anyways. one part of this would be to keep
a reference on it or flag it accordingly and apply actuall arguments after
it has been creted and passed through the arg system.

> 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).

this is how ::tab_label and ::menu_label currently work anyways.
as i mentioned, providing the possibility to pass the tab_label and
menu_label as widget pointers would be an advanced option, from the
GUI builder side, as well as from the GUI builder user side.

> 
> Damon
> 

---
ciaoTJ



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