我對Tkinter很新。我在Tkinter製作了這個「Hello World」式的GUI程序。但是,每次單擊退出按鈕時,程序都會崩潰。提前致謝!tkinter退出崩潰
from Tkinter import *
import sys
class Application(Frame):
def __init__(self,master=None):
Frame.__init__(self,master=None)
self.grid()
self.createWidgets()
def createWidgets(self):
self.quitButton = Button(text='Quit',command=self.quit)#Problem here
self.quitButton.grid()
app = Application()
app.master.title("Sample application")
app.mainloop()
您的縮進不正確。請花時間發佈準確的代碼樣本。 – 2013-03-10 15:06:59