Re: a couple of newbie questions regarding developing apps in GTK+



On Saturday 16 June 2001 07:55 pm Ivica Bukvic shared with us the following 
piece of wisdom:
1) When creating a front-end in Glade, the sources of the code get dumped
in such a way that interface.c file contains function(s) that pertain to
building the actual widgets and windows. The problem I am having with this
is that when I try to reference any of the widgets, their pointer address
is always null (due to fact that all of their references vanish when the
execution of the above mentioned function is done and returns just a
pointer to itself, but I am unable to discern from either the book or
online examples what is the hierarchy between let's say the default window
and different widgets that belong to that window). I tried making pointers
to widgets static and even static const, but those did not help either and
I still kept getting "null" pointer errors when trying to reference any of
the widgets.

Any widget that's around (has been created and has not been destroyed yet) 
can be refernced as long as the pointer to that widget is within scope. I 
might be able to give more specifc advice if you post some example of what 
you're trying to do.

Then, I saw that the above mentioned book implements
widget/window creation in the main() function and thus circumvents some of
these issues since main function is familiar of its elements at all times.

I usually create main window and everything inside it in main(), stuff that 
belongs to other windows (if any) goes into other files, but that's just me :)

My question is how can I utilize Glade's implementation and still have
access to all widgets by other functions? (obviously interfaces.h is
included in other sources so that is not the issue) How come that static
implementation does not yield results? What reprecussions does
implementation of widget construction in the main() function create

None whatsoever.

since
(as I currently understand it) main() function constantly cycles itself?

It doesn't unless you write something like:

int main() {
  while (TRUE) {
  ....
  ....
  }
  return 0;
}

Any kind of example code would be greatly appreciated!

Check out this one:

http://developer.gnome.org/doc/GGAD/ggad.html

3) Finally, is there a website where you can see a complete list of
functions/classes that are implemented in the GTK and their data members
that they take on (kind of like man pages for every gtk_* instruction)?

Yep, there sure is:

http://www.gtk.org/api/

-- 
Bye, Warrior.

ICQ #24496762

-------------
Tagline for Sunday, June 17, 2001, 00:05
--- A Bugless Program is an Abstract Theoretical Concept.




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