[Tutor] How to insert a quit-Button in a Tkinter class?

Steve Willoughby steve at alchemy.com
Wed Jan 12 20:45:25 CET 2011


On 12-Jan-11 11:41, Enih Gilead wrote:
> Hi, all !
>
> I've being strugling a lot trying to insert (just as exemple) a
> quit-Button in a Tkinter class App with no success... What I get is the
> clock runing ok, but, the App simply ignores the quit-Button... Why?

Maybe I'm missing something, but you define your own class (not 
inheriting from a parent class which might give you inherited methods), 
and then bind the "Quit" button to the quit() method of your class:

> class App():
...
> self.quitButton = Button( self, text='Quit', command=self.quit )

But where is the quit() method actually defined?

-- 
Steve Willoughby / steve at alchemy.com
"A ship in harbor is safe, but that is not what ships are built for."
PGP Fingerprint 48A3 2621 E72C 31D9 2928 2E8F 6506 DB29 54F7 0F53


More information about the Tutor mailing list