[# File: menu-example-5.py
from Tkinter import *
counter = 0
def update():
global counter counter = counter + 1 menu.entryconfig(0, label=str(counter))
root = Tk()
menubar = Menu(root)
menu = Menu(menubar, tearoff=0, postcommand=update) menu.add_command(label=str(counter)) menu.add_command(label="Exit", command=root.quit)
menubar.add_cascade(label="Test", menu=menu)
root.config(menu=menubar)
mainloop()
Category Category]
What is this?