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?

_*Remark*_:
I took this minimalist digital clock just to illustrate the "bad :-)" class behavior, but it didn't work in any other Apps I tried. I searched a lot (indeed!) in the net but I couldn't find the reason.

Could any of you tell me, please, _*what's the problem?*_
Thanks,
enihgil

###################################

import Tkinter
import time

class App():
    def __init__(self):
        self.root = Tkinter.Tk()
        self.label = Tkinter.Label(text="")
        self.label.grid()
        self.update_clock()
        self.root.mainloop()

    def update_clock(self):
        now = time.strftime("%H:%M:%S")
        self.label.configure(text=now)
        self.root.after(1000, self.update_clock)

    def createButton(self):
        self.quitButton = Button( self, text='Quit', command=self.quit )
        self.quitButton.grid()

app=App()
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to