Tkinter destroy


import Tkinter as tk
class MyWindow(object):
def __init__(self):
self.root = tk.Tk()
button=tk.Button(self.root, text='NEXT', command=self.OnNext)
button.pack()

def OnNext(self):
win = MyWindow()
self.root.destroy()

win = MyWindow()
win.root.mainloop()


你可能感兴趣的:(Tkinter destroy)