[Glade-users] globals vs locals... again

James Cameron james.cameron@compaq.com
Fri, 06 Oct 2000 13:50:17 +1100


"James K. Wiggs" wrote:
> The names assigned to the various widgets in these sub-GUIs are
> generated automatically when they are created, but it would be possible
> for duplicate names to be created.  If this is the case, what will
> lookup_widget() do?

It will return the latest created widget with the name you specify, I
think.

See support.c, function lookup_widget(), and the code in interface.c
which performs gtk_object_set_data() calls for each widget created.  The
function works by associating a named piece of data with the toplevel
widget.  The name is the widget being created.

I recall one Motif interface builder made by Digital that refused to let
you have a widget name that was duplicated.  The tool itself took care
of making sure it was unique.  It even went so far as to change all the
widget names when you pasted a copy of the widget tree somewhere else. 
Painful.  I don't think it is enough of a problem to require Glade to do
this.

-- 
James Cameron                                      (cameron@stl.dec.com)