下面的例子讲如何制作简单的菜单:
初始化窗口:
点击子菜单New:
继续点击其他子菜单
代码:
import tkinter as tk
window = tk.Tk()
window.title('my window')
window.geometry('200x200')
l = tk.Label(window, text='', bg='yellow')
l.pack()
counter = 0
def do_job():
global counter
l.config(text='do '+ str(counter))