Re: PROPOSAL: GTK_WIDGET_COMPOSITE_CHILD flag



On 24 Aug 1998, Marius Vollmer wrote:

> Tim Janik <timj@gtk.org> writes:
> 
> > comments? better ideas to solve the GUI builder problem?
> 
> I think the GUI builder should try hard to solve its own problems.
> Could it be enough that it is able to identify the widgets that it has
> created *itself*?  After all, what's the difference between a widget
> created by Gtk code, and by some other user code?  Identifying its own
> widgets can easily be done with gtk_object_set_data, etc.

well, it is actually not that easy. GLE currently alowes to query
existing widget trees, and dump this description to stdout. at a later
date i'd like to parse such descriptions and build a new widget tree
from it. within this tree it needs to be possible to adjust arguments
on composite's children, but such widgets certainly must not be
created.

> I think this COMPOSITE_CHILD thing is too ill defined.  What if I
> write a function that creates a special customized version of a file
> selection dialog?  Are my newly added widgets `composite childs' or

this depends on whether you'd want the GUI builder to create these
additional widgets for you or not. but the normal approach for an
implementation of an extended FS dialog with major customization
would probably be to derive from it, and then you are responsible
for having your children be flagged GTK_WIDGET_COMPOSITE_CHILD.

> not?  From the point of the user of my function, they are.  From the
> point of the original file selector they are not.  And from the point
> of a GUI builder?

i've pretty much covered the case you refer to in a short example
in my mail. if you really just add a simple extra button to the FS,
just proceed as usual, and it will not be flagged GTK_WIDGET_COMPOSITE_CHILD.

> I think (whoa, already thought the third time this morning, gotta get
> some coffee) what you really want is some kinf of `creatorship'
> indication, so that the GUI builder can know whether it is allowed to
> mess with the widgets or not, right?  Just flagging widgets created by
> the GUI builder could be good enough, by using gtk_object_set.

as i said, this view is too easy, for a fully generic GUI builder, information
needs to be provided if certain widgets will be created automatically, or if
it is the GUI builders responsibility to do that. if the user messes around
with the widget tree after the GUI builder creates it for him, isn't actually
much of an issue. the GUI builder can then (if reinvoked for that tree)
seperate out these widgets quite easily through its own tag and the
GTK_WIDGET_COMPOSITE_CHILD flag, as the users widget is in that sense
actually "flag-less". providing an owner-ship mechanism, e.g. by requiring
extra gtk_widget_set_owner() gtk_widget_get_owner() additions would put
a big burden on the widget programmer, and would simply be overkill for a
small problem that can be solved with a stackable flag as easy as
GTK_WIDGET_COMPOSITE_CHILD. also i don't see people provide actuall owner
strings, since they most cases don't even give widgets a unique name
identifier.

> 
> - Marius
> 

---
ciaoTJ



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