Initial stab at scrollwheel functionality - not quite working yet

This commit is contained in:
Anna 2010-04-07 13:07:26 -04:00
parent db1cdda40b
commit b74b992ad7

View File

@ -26,7 +26,8 @@ class TwitWindow:
# Create the scrolled frame that will hold the tweets
self.tweet_view = Pmw.ScrolledFrame(self.tkroot, hscrollmode='none', horizflex='elastic')
self.tweet_view.pack(expand=Tkinter.YES, fill=Tkinter.BOTH)
self.tweet_view.bind("<MouseWheel>", self.scroll_wheel);
self.tweet_view.bind("<Button-4>", self.scroll_wheel);
self.tweet_view.bind("<Button-5>", self.scroll_wheel);
# Create labels and text widgets
for i in range(0, self.num_entries):
@ -75,6 +76,12 @@ class TwitWindow:
UpdateWindow()
def scroll_wheel(self, event):
if event.num == 4:
self.tweet_view.xview('scroll', 1, 'units');
print "DEBUG: scrolling positive"
if event.num == 5:
self.tweet_view.xview('scroll', -1, 'units');
print "DEBUG: scrolling negative"
### end class TwitWindow