Added some new bindings
This commit is contained in:
parent
4906fa7fe7
commit
928b75ab95
18
mytwitter.py
18
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("<Button-4>", self.scroll_wheel);
|
||||
self.tkroot.bind_all("<Button-5>", self.scroll_wheel);
|
||||
self.tkroot.bind_all("<Prior>", self.page_up);
|
||||
self.tkroot.bind_all("<Next>", self.page_down);
|
||||
self.tkroot.bind_all("<Button-4>", self.scroll_wheel)
|
||||
self.tkroot.bind_all("<Button-5>", self.scroll_wheel)
|
||||
self.tkroot.bind_all("<Up>", self.line_up)
|
||||
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
|
||||
self.update_entry.bind('<KeyRelease>', 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)
|
||||
|
|
Reference in New Issue
Block a user