[Glade-users] globals vs locals



Friedrich Steven E CONT CNIN wrote:

My app is a maintenance panel and it changes the style of widgets to
visually convey info.  When Glade generates the app, it declares all the
widget pointers as local in interface.c.  Since I need to use the pointers
in many other modules, I remove them from interface.c and place them in
main.h and externs.h (with an extern keyword).  This works, but everytime I
regen the app, I have to perform this step again, and it's getting more
troublesome as the app grows.  Is there an easier way??

Have you seen the lookup_widget() function which Glade provides for you?

If you don't want to use lookup_widget() all the time, you can just do it
once when you create the window, and keep all the pointers to the widgets
you need in a struct somewhere.

Damon






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