Re: Use the source Luke!!



On Sunday 07 December 2003 16:39, weasel wrote:

Ok, so I have been working feverishly at learning Gtk+.  After quite a
bit of failed searching for help and docs on the web, I thought, ok, let
me check the source.  I tried and tried to find where in the Gtk+ source
the signals for various Widgets are defined.  I have come up empty
handed.  Anyone know where I can find this info?

You don't need to check the source to find out which signals are defined for a 
widget. Check the API reference instead:

  http://developer.gnome.org/doc/API/2.0/gtk/index.html

There you'll find a list of signals (and callbacks) for each widget. You 
should also have a look at the object hierarchy (which is also in the API 
reference for each widget), as all widgets also inherit the signals of their 
parent classes.

For example, let's take GtkCheckButton:

  http://developer.gnome.org/doc/API/2.0/gtk/GtkCheckButton.html

No GtkCheckButton-specific signals are listed in the API reference. However, 
the object hierarchy shows that GtkCheckButton is derived from 
GtkToggleButton, which in turn is derived from GtkButton, which is (skipping 
a couple of classes) derived from GtkWidget, which is derived from GtkObject, 
and finally from GObject.

If you then go to check the reference for the immediate parent GtkToggleButton

   http://developer.gnome.org/doc/API/2.0/gtk/GtkToggleButton.html

you will see a "toggled" signal listed. This signal will also be emitted if 
the checkbox is toggled. Same goes for the other parents as well (e.g. 
GtkWidget).

etc.

Cheers
-Tim





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