Check box menu : Menu Checkbox : GUI Tk PYTHON examples


PYTHON examples » GUI Tk » Menu Checkbox »

 

Check box menu


Check box menu


from Tkinter import *

class TestMenu:
    def __init__(self, master):
  self.master = master
  self.menubar = Menu(self.master)

        self.chkmenu = Menu(self.menubar)
        self.chkmenu.add_checkbutton(label='A')
        self.chkmenu.add_checkbutton(label='B')
        self.chkmenu.add_checkbutton(label="C")
        self.chkmenu.add_checkbutton(label='D')
        self.chkmenu.add_checkbutton(label='E')    
        self.chkmenu.invoke(self.chkmenu.index('C'))

        self.menubar.add_cascade(label="Checkbutton Menu", menu=self.chkmenu)

  self.top = Toplevel(menu=self.menubar, width=500, relief=RAISED,
                            borderwidth=2)

def main():
    root = Tk()
    root.withdraw()
    app = TestMenu(root)
    root.mainloop()

if __name__ == '__main__':
    main()

           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


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


PYTHON examples

 Navioo GUI Tk
» Menu Checkbox