from TKinter import *
class Ui(Frame):
def __init__(self)
Frame.__init__(self, None)
self.grid()
bquit=Button(self, text="Quit", command=self.quit_pressed)
bquit.grid(row=0, column=0)
def quit_pressed(self):
self.destroy()
app=Ui()
app.mainloop()
Why doesn’t this Tkinter program end properly when I press the “Quit” button?
With self.destroy() you’re just destroying the Frame, not the the top level container, you need to do self.master.destroy() for it to exit correctly