quit button

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Oct 27 05:07:07 CET 2009


En Sat, 24 Oct 2009 23:59:06 -0300, linda.s <samrobertsmith at gmail.com>  
escribió:

> When I click "quit" button, why the following code has problem?
>
> [...]
>
> if __name__ == '__main__':
>     root = Tk()
>     gridbox(Toplevel())
>     packbox(Toplevel())
>     Button(root, text='Quit', command=root.quit).pack()
>     mainloop()

If you run the code from inside IDLE, you'll have to add this line at the  
end:

     root.destroy()

as explained here:

http://www.effbot.org/tkinterbook/tkinter-hello-again.htm

-- 
Gabriel Genellina




More information about the Python-list mailing list