help with an error in Tkinter

Wayne infotechsys at pivot.net
Tue Dec 14 12:18:18 EST 1999


Hello,
I'm reading the book(?) " An introduction to Tkinter" and in doing one
of the example
on Checkbutton Widget I get an error that I don't know how to resolve.
Here is the program
with a slight change - I left the "Quit" button code in from an earlier
example.

from Tkinter import *

class App:
     def __init__(self, master):
          self.var = IntVar()
          c = Checkbutton(master, text = "Enable Tab", variable =
self.var, command = self.cb
          c.pack()

          self.button = Button(master, text = "Quit", fg = "red",
commnad = master.quit
          self.button.pack()

     def cb(self, event):
          print "variable is", self.var.get()

root = Tk()
app = App(root)
root.mainloop()


The error I'm getting:

Exception in Tkinter callback
Traceback (innermost last):
File "/var/tmp/python-root/usr/lib/python1.5/lib-tk/Tkinter.py", line
752, in __call__
return apply(self.func, args)
TypeError: not enough arguments; expected 2, got 1





More information about the Python-list mailing list