why tkinter do not quit?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

why tkinter do not quit?

luofeiyu
here is my program:
from Tkinter import *
def helloButton():
    print 'hello button'
    root.quit
root = Tk()
Button(root,text = 'Hello Button',command = helloButton).pack()
root.mainloop()

when i click on my  button,print is ok,why  root.quit have no effect?

_______________________________________________
Tkinter-discuss mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/tkinter-discuss
Reply | Threaded
Open this post in threaded view
|

Re: why tkinter do not quit?

Igor Novikov
Hi,

root.quit is a reference to object field but not a quit() method.
Try using root.quit() This should resolve an issue.

--
Regards,

Igor Novikov
sK1 Project
http://sk1project.org

2011/8/9 守株待兔 <[hidden email]>
here is my program:
from Tkinter import *
def helloButton():
    print 'hello button'
    root.quit
root = Tk()
Button(root,text = 'Hello Button',command = helloButton).pack()
root.mainloop()

when i click on my  button,print is ok,why  root.quit have no effect?

_______________________________________________
Tkinter-discuss mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/tkinter-discuss





_______________________________________________
Tkinter-discuss mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/tkinter-discuss