Add action command to menu item : Menu : Tkinker PYTHON TUTORIALS


PYTHON TUTORIALS » Tkinker » Menu »

 

Add action command to menu item


Add action command to menu item
from Tkinter import *    
root    = Tk()
mbutton = Menubutton(root, text='Food')     # the pull-down stands alone
picks   = Menu(mbutton)               
mbutton.config(menu=picks)           
picks.add_command(label='spam',  command=root.quit)
picks.add_command(label='eggs',  command=root.quit)
picks.add_command(label='bacon', command=root.quit)
mbutton.pack()
mbutton.config(bg='white', bd=4, relief=RAISED)
root.mainloop()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Tkinker
» Menu