Re: getting a GtkWidget*



Yes, but in order to do this you need to use libglade to dynamically load
the XML file at runtime to create the widgets. You can give each widget a
name, and then call glade_xml_get_widget(GladeXML *self, char *name) to get
a pointer to the GtkWidget.

If you aren't using libglade, but having glade pregenerate the code for you,
i'm not perfectly sure what the proper solution is.

Loban.

> I haven't been able to hit on quite the right thing in the FAQ or docs. I've
> been working with glade, which doesn't expose the widgets used in the
> generated interface.c file. If I have connected a callback to a button
> click, for instance, and I would like to get the text from an GetEntry
> widget, is there a graceful way to get a pointer to the entry?
> 
> It looks like my options are passing a GList of the widget pointers I'll be
> interested in during the callback, or getting the ancestor container of the
> button and iterating through the children.
> 
> Is there anything analogous to XtNameToWidget?

/-------------------------------------------------------------------\
|   Loban Amaan Rahman  <-- anagram of -->  Aha! An Abnormal Man!   |
|  loban earthling net, loban ugcs caltech edu,  http://i.am/loban  |
\-------------------------------------------------------------------/




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