import tkinter as tk
def on_closing():
root.destroy()
class MainWindow(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
root = MainWindow()
root.title('Main Window')
root.protocol("WM_DELETE_WINDOW", on_closing)
root.geometry('640x480')
root.mainloop()
沒有留言:
張貼留言