Initial stab at scrollwheel functionality - not quite working yet
This commit is contained in:
parent
db1cdda40b
commit
b74b992ad7
|
@ -26,7 +26,8 @@ class TwitWindow:
|
||||||
# Create the scrolled frame that will hold the tweets
|
# Create the scrolled frame that will hold the tweets
|
||||||
self.tweet_view = Pmw.ScrolledFrame(self.tkroot, hscrollmode='none', horizflex='elastic')
|
self.tweet_view = Pmw.ScrolledFrame(self.tkroot, hscrollmode='none', horizflex='elastic')
|
||||||
self.tweet_view.pack(expand=Tkinter.YES, fill=Tkinter.BOTH)
|
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
|
# Create labels and text widgets
|
||||||
for i in range(0, self.num_entries):
|
for i in range(0, self.num_entries):
|
||||||
|
@ -75,6 +76,12 @@ class TwitWindow:
|
||||||
UpdateWindow()
|
UpdateWindow()
|
||||||
|
|
||||||
def scroll_wheel(self, event):
|
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
|
### end class TwitWindow
|
||||||
|
|
Reference in New Issue
Block a user