Added some new bindings

This commit is contained in:
Anna 2010-04-07 15:57:34 -04:00
parent 4906fa7fe7
commit 928b75ab95

View File

@ -60,10 +60,12 @@ class TwitWindow:
### Set up bindings ### Set up bindings
# Bind scrollwheel to move the tweets, as well as page up/down # Bind scrollwheel to move the tweets, as well as page up/down
self.tkroot.bind_all("<Button-4>", self.scroll_wheel); self.tkroot.bind_all("<Button-4>", self.scroll_wheel)
self.tkroot.bind_all("<Button-5>", self.scroll_wheel); self.tkroot.bind_all("<Button-5>", self.scroll_wheel)
self.tkroot.bind_all("<Prior>", self.page_up); self.tkroot.bind_all("<Up>", self.line_up)
self.tkroot.bind_all("<Next>", self.page_down); self.tkroot.bind_all("<Down>", self.line_down)
self.tkroot.bind_all("<Prior>", self.page_up)
self.tkroot.bind_all("<Next>", self.page_down)
# Bind any key in the update_entry to adjust the counter, except return # Bind any key in the update_entry to adjust the counter, except return
self.update_entry.bind('<KeyRelease>', self.char_counter) self.update_entry.bind('<KeyRelease>', self.char_counter)
@ -123,6 +125,14 @@ class TwitWindow:
self.tweet_view.yview('scroll', 15, 'units'); 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): def char_counter(self, event):
new_count = str(len(self.update_entry.get())) + "/140" new_count = str(len(self.update_entry.get())) + "/140"
self.update_count.config(text=new_count) self.update_count.config(text=new_count)