[Glade-users] GtkScrollbar signals

Damon Chaplin damon@ximian.com
Thu, 10 May 2001 12:48:49 -0400


Ed Winchester wrote:
> 
> Hello, all,
> 
> I've asked this list before about Glade data for my simulator project.
> In my user interface (created by Glade), I have a scrollbar which
> controls which 6 of 50 possible words of a message are
> displayed/edited.  From reading the API reference, what I would want to
> get is the signal gtk_adjustment_value_changed ().  This one signal
> provides all the information I need, whatever operation the user has
> performed on the scrollbar.  But, I can't figure out how to get to this
> GtkAdjustment.  Glade creates the VScrollbar, which in the
> Glade-generated file interfaces.c, creates a new GtkAdjustment.  How
> would I connect to the gtk_adjustment_value_changed () signal from this
> adjustment?  I could see how to do it is I edited the interfaces.c file,
> but that's verboten.  A brief example would be appreciated.

After calling create_window1() or whatever to create the window, use
lookup_widget() to get a pointer to the scrollbar. You can then get the
adjustment from the scrollbar (it is a subclass of GtkRange), and connect
to any signals.

Damon