[Glade-users] Finding widget from its name?

Tristan Van Berkom tvb at gnome.org
Tue Aug 15 09:20:18 EDT 2006


jan at talentex.demon.co.uk wrote:
> Is there a function that allows one to search for a widget using its 
> name or label? I'm using Glade 2 to design a window (just a basic input form),
> and each widget has a unique name. Unfortunately Glade doean't save any
>  global pointers to the widgets; I can only assume that there must
> be another way to find the objects from within the callback functions.

Sure,
    when you call glade_xml_get_widget (GladeXML *xml, gchar *widget_name)
you immediately get the widget by its name in the dynamicly constructed
UI, later you can always recurse down the gtk toplevels searching for a widget
by its name, but usually its easy and possible to just pass the pointer around
once its been initially obtained at initialization time.

Cheers,
                         -Tristan

BTW: try glade 3 :)


More information about the Glade-users mailing list