gnope php gtk gui gnope.org  

Detecting scrolling from a scroll window

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
asnth



Joined: 31 Aug 2006
Posts: 7

PostPosted: Mon Sep 04, 2006 5:43 pm    Post subject: Detecting scrolling from a scroll window Reply with quote

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

PostPosted: Mon Sep 04, 2006 5:53 pm    Post subject: Reply with quote

Perhaps you can use the changed signal of the scrolled window's gtkadjustment widgets.
Back to top
asnth



Joined: 31 Aug 2006
Posts: 7

PostPosted: Mon Sep 04, 2006 9:05 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.