From 928b75ab95be0f9be1379b1d49d0e7342dc9ac58 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 7 Apr 2010 15:57:34 -0400 Subject: [PATCH] Added some new bindings --- mytwitter.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mytwitter.py b/mytwitter.py index c9ee053..6caa2dc 100755 --- a/mytwitter.py +++ b/mytwitter.py @@ -60,10 +60,12 @@ class TwitWindow: ### Set up bindings # Bind scrollwheel to move the tweets, as well as page up/down - self.tkroot.bind_all("", self.scroll_wheel); - self.tkroot.bind_all("", self.scroll_wheel); - self.tkroot.bind_all("", self.page_up); - self.tkroot.bind_all("", self.page_down); + self.tkroot.bind_all("", self.scroll_wheel) + self.tkroot.bind_all("", self.scroll_wheel) + self.tkroot.bind_all("", self.line_up) + self.tkroot.bind_all("", self.line_down) + self.tkroot.bind_all("", self.page_up) + self.tkroot.bind_all("", self.page_down) # Bind any key in the update_entry to adjust the counter, except return self.update_entry.bind('', self.char_counter) @@ -123,6 +125,14 @@ class TwitWindow: self.tweet_view.yview('scroll', 15, 'units'); + def line_up(self, event): + self.tweet_view.yview('scroll', -5, 'units'); + + + def line_down(self, event): + self.tweet_view.yview('scroll', 5, 'units'); + + def char_counter(self, event): new_count = str(len(self.update_entry.get())) + "/140" self.update_count.config(text=new_count)