Update main window when Update on Click is turned on

This commit is contained in:
Barry Warsaw 1998-10-06 18:56:31 +00:00
parent ad3a67cc84
commit 56af4448e1
1 changed files with 7 additions and 1 deletions

View File

@ -80,7 +80,8 @@ class ListViewer:
self.__uoc.set(1) self.__uoc.set(1)
self.__uocbtn = Checkbutton(root, self.__uocbtn = Checkbutton(root,
text='Update on Click', text='Update on Click',
variable=self.__uoc) variable=self.__uoc,
command=self.__toggleupdate)
self.__uocbtn.pack(expand=1, fill=BOTH) self.__uocbtn.pack(expand=1, fill=BOTH)
# #
# alias list # alias list
@ -115,6 +116,11 @@ class ListViewer:
self.__sb.update_views(red, green, blue) self.__sb.update_views(red, green, blue)
else: else:
self.update_yourself(red, green, blue) self.update_yourself(red, green, blue)
self.__red, self.__green, self.__blue = red, green, blue
def __toggleupdate(self, event=None):
if self.__uoc.get():
self.__sb.update_views(self.__red, self.__green, self.__blue)
def __quit(self, event=None): def __quit(self, event=None):
sys.exit(0) sys.exit(0)