Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Tkinter toplevel communication
  2. class MyTopWindow:
  3.  
  4.     def __init__(self):
  5.         self.widget1 = Widget
  6.         self.widget2 = Widget
  7.         self.button = Button
  8.  
  9.         #self.button.clicked -> self.handler  
  10.  
  11.     def handler(self):
  12.         self.widget1.someAttribute = 1
  13.  
  14. button.click() # -> handler()