def create_test_menu(): topmenuitem = create_menu('Top Menu', 'Exit') submenuitem = create_submenu('Level One Menu', 'Exit', topmenuitem) subsubmenuitem = create_submenu('Level Two Menu', 'Exit', submenuitem) add_menu_item_action(topmenuitem, 'TopLevelMenuItemOne', Called('Called action'), topmenuitem) add_menu_item_action(submenuitem, 'LevelTwoMenuItemOne', Called('Called submenu action'), topmenuitem) add_menu_item_action(subsubmenuitem, 'LevelThreeMenuItemOne', Called('Called subsubmenu action'), topmenuitem) add_menu_item_action(topmenuitem, 'TopLevelMenuItemTwo', Called('Called2 action'), topmenuitem) topmenuitem.show()
def test_new_menu(): menu = create_menu('Top Menu', 'Exit')
def test_create_submenu(): menu = create_menu('Top Menu', 'Exit') submenu = create_submenu('Sub Menu', 'Exit', menu)
def create_exception_test_menu(): topmenu = create_menu('Top Menu', 'Exit') add_menu_item_action(topmenu, 'Throws Exception', throw_exception, topmenu) topmenu.show()
if __name__ == "__main__": from menucli import create_menu, add_menu_item_action menu = create_menu('Main Menu', 'Exit') def menu_Item(): print('Called Menu Item Method') add_menu_item_action(menu, 'Menu Item', menu_Item, menu) menu.show()