from Tkinter import *class TestMenu: def __init__(self, master): self.master = master self.menubar = Menu(self.master) self.radmenu = Menu(self.menubar) self.radmenu.add_radiobutton(label='A') self.radmenu.add_radiobutton(label='B') self.radmenu.add_radiobutton(label='C') self.radmenu.add_radiobutton(label='D') self.radmenu.add_radiobutton(label='E') self.radmenu.add_radiobutton(label='F') self.radmenu.add_radiobutton(label='H') self.radmenu.add_radiobutton(label='L') self.radmenu.add_radiobutton(label='Z') self.menubar.add_cascade(label="Radiobutton Menu", menu=self.radmenu) self.menubar.entryconfig(1, state=DISABLED) 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()
Name (required)
email (will not be published) (required)
Website