[Glade-users] Moving the scrollbar of two distinct window synchronously

Damon Chaplin damon@ximian.com
Fri, 15 Jun 2001 16:54:00 -0400


Jean-Christophe Berthon wrote:
> 
> Hy there,
> 
> I have a small question to all of you, I need to have two distinct window
> with in each a list of features and when I move a scrollbar of one of them
> I'd like the other one to move synchronously (or accordingly). Because each
> features of one window is related to another one of the other window.
> How can I do that in Glade? It seems that there is no callback for the
> scrollbars so how can I do it?
> Any idea or suggestions would be greatly appreciate :-)))

Maybe you could connect to the "value_changed" signals of the scrollbars'
adjustments.

This may help from the FAQ:

4.9 How do I connect to GtkAdjustment signals?

Glade doesn't support this at present, but you can set it up manually, in a
similar way to question 3.6.

When you create the window, get a pointer to the widget containing the
adjustment, and connect to the "changed" or "value_changed" signals:

  window1 = create_window1 ();
  hscale = lookup_widget (window1, "hscale1");
  gtk_signal_connect (GTK_OBJECT (GTK_RANGE (hscale)->adjustment),
                      "changed", GTK_SIGNAL_FUNC (on_adjustment_changed),
                      NULL);




Damon