Tkinter question (reposted)
Michael Bauers
me at michaelbauers.com
Thu May 30 09:36:26 EDT 2002
The online docs had a code snippet that was not working as shown. I had to
remove the 'event' parameter from the callback 'cb'. Did I mess up, or is
this a matter of version differences between the doc, and Python 2.2?
My modified def line looked like:
def cb(self)
This is what was in the docs:
def __init__(self, master):
self.var = IntVar()
c = Checkbutton(master, text="Enable Tab",
variable=self.var, command=self.cb)
c.pack()
def cb(self, event):
print "variable is", self.var.get()
More information about the Python-list
mailing list