Advertisement
virtualideaz

Python Menubutton Sample

Oct 23rd, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. top = Tk()
  4.  
  5. mb=  Menubutton ( top, text="condiments", relief=RAISED )
  6. mb.grid()
  7. mb.menu  =  Menu ( mb, tearoff = 0 )
  8. mb["menu"]  =  mb.menu
  9.    
  10. mayoVar  = IntVar()
  11. ketchVar = IntVar()
  12.  
  13. mb.menu.add_checkbutton ( label="mayo",
  14.                           variable=mayoVar )
  15. mb.menu.add_checkbutton ( label="ketchup",
  16.                           variable=ketchVar )
  17.  
  18. mb.pack()
  19. top.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement