[Glade-users] Problems with lookup_widget()



James Cameron wrote:

Sarah Mount wrote:
Ah...now I thought of this. I already have globals that are pointers
to my dialog boxes, but not one to my main_application widget. Thing
is, where do I set it? With the dialog boxes I set the globals when
the widgets are created, but the main_application widget already
exists. Argh!

You can make changes to main.c without Glade losing them.  So if you
have gone for globals, capture the widget pointer for the main widget
after it is created.

Another way to do this is to create a main window mapped callback.


Remember though that this will only be triggered with the main window is
displayed, so the pointer will be unavailable prior to this.  This
temporal coupling may be a problem and you should be aware of it.

Also, if you are using libglade make sure you upgrade to the latest
version, as older versions didn't support the map event (strange but
true), which caused much scratching of head and weird pondering when I
tried to use it last :).

Andrae





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