Simple Checkbutton Question? Please....
Josiah
josiah7 at hotmail.com
Sat Nov 23 00:00:22 EST 2002
What am I doing wrong in this sample? When I press the "status"
button, the printout shows that "self.var.get()" returns a "0" weather
the box is checked or not! Help please.
Thanks!
josiah
#######################################################################
from Tkinter import *
root = Tk()
class App:
def __init__(self, master):
frame = Frame(master)
frame.grid()
self.var = IntVar()
self.CButton = Checkbutton(frame,
text="check",variable=self.var)
self.CButton.select()
self.CButton.grid()
self.buttonGo = Button(frame, text= "status", command=self.go)
self.buttonGo.grid()
def go(self):
print self.var.get()
app = App(root)
root.mainloop()
root.quit
#######################################################################
More information about the Python-list
mailing list