| View previous topic :: View next topic |
| Author |
Message |
asnth
Joined: 31 Aug 2006 Posts: 7
|
Posted: Mon Sep 04, 2006 5:43 pm Post subject: Detecting scrolling from a scroll window |
|
|
| So i've got a GtkTextView inside a scrolled window. Using the "scroll_event" signal i can detect the roll of a mouse wheel as the window is scrolled. But when i scroll the window by clicking and dragging the scrollbar or by clicking the scrollbar buttons, nothing happens. How can i detect these actions? |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Mon Sep 04, 2006 5:53 pm Post subject: |
|
|
| Perhaps you can use the changed signal of the scrolled window's gtkadjustment widgets. |
|
| Back to top |
|
 |
asnth
Joined: 31 Aug 2006 Posts: 7
|
Posted: Mon Sep 04, 2006 9:05 pm Post subject: |
|
|
It worked! thanks.
For the benefit of other readers, here's how:
$vadj = $scrollwindow -> get_vadjustment(); // get the vertical adjustment widget
$vadj -> connect ('value-changed', array (&$this, 'scroll_it') ); // listen for a signal change from the scrolling
function scroll_it ($item, $event) {
echo "Detecting scrolling now\n";
}
I used it to make two separate textviews scroll simultaneously, by setting both textviews to have the same vadjustment. |
|
| Back to top |
|
 |
|