Re: How to create unique widget when reusing widget id's from a GladeXML object.
- From: Olivier Guilyardi <ml xung org>
- To: dhk <dhkuhl optonline net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: How to create unique widget when reusing widget id's from a GladeXML object.
- Date: Tue, 12 Aug 2008 12:58:05 +0200
How can a unique widget be created by using the same widget from a
GladeXML object multiple times?
You can use different GladeXML objects, constructed out of the same glade file.
GladeXML *xml = glade_xml_new("test.glade", NULL, NULL);
GtkWidget *widget1 = glade_xml_get_widget(xml, "mywidget");
GladeXML *xml2 = glade_xml_new("test.glade", NULL, NULL);
GtkWidget *widget2 = glade_xml_get_widget(xml2, "mywidget");
Here widget1 and widget2 (and their children) are different "instances" of mywidget.
About performance, from the liblglade manual : "the XML parse tree is cached to
speed up creating another GladeXML object for the same file".
Olivier Guilyardi / Samalyse
] [Thread Prev