[Tutor] Tkinter quit frame

Michael P. Reilly arcege@speakeasy.net
Sun, 10 Mar 2002 12:44:42 -0500


On Fri, Mar 08, 2002 at 10:44:21PM +0100, Keule wrote:
> Hallo ! 
> 
> In the "programming python" book i read about a quitter.py method and i want to use it for my own
> , this is the code:
> 
> from Tkinter import *                          # get widget classes
> from tkMessageBox import askokcancel           # get canned std dialog
> 
> class Quitter(Frame):                          # subclass our GUI
>     def __init__(self, parent=None):           # constructor method
>         Frame.__init__(self, parent)
>         self.pack()
>         widget = Button(self, text='Quit', command=self.quit)
>         widget.pack(expand=YES, fill=BOTH, side=LEFT)
>     def quit(self):
>         ans = askokcancel('Verify exit', "Really quit?")
>         if ans: Frame.quit(self)
> 
> if __name__ == '__main__':  Quitter().mainloop()
> 
> 
> unfortunatly i get a big memory allocation error after running this script. 
> had anyone else perhaps the same problem ? 

I don't have a problem when I run it.  What system are you using and what
version of Python?

  -Arcege