diff --git a/mytwitter.py b/mytwitter.py index ed9e699..67ef4f1 100755 --- a/mytwitter.py +++ b/mytwitter.py @@ -28,8 +28,11 @@ 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("", self.scroll_wheel); - self.tweet_view.bind("", self.scroll_wheel); + + # Bind scrollwheel to move the tweets. Might as well allow scrollwheel + # from anywhere, so we'll bind to tkroot + self.tkroot.bind("", self.scroll_wheel); + self.tkroot.bind("", self.scroll_wheel); # Create labels and text widgets for i in range(0, self.num_entries): @@ -79,11 +82,9 @@ class TwitWindow: def scroll_wheel(self, event): if event.num == 4: - self.tweet_view.xview('scroll', 1, 'units'); - print "DEBUG: scrolling positive" + self.tweet_view.yview('scroll', -5, 'units'); if event.num == 5: - self.tweet_view.xview('scroll', -1, 'units'); - print "DEBUG: scrolling negative" + self.tweet_view.yview('scroll', 5, 'units'); ### end class TwitWindow