SubmenuItem¶
Bases: consolemenu.items.MenuItem
-
class
consolemenu.items.
SubmenuItem
(text, submenu, menu=None, should_exit=False, menu_char=None)[source]¶ A menu item to open a submenu
Variables: - text (str) – The text shown for this menu item
- submenu (ConsoleMenu) – The submenu to be opened when this item is selected
- menu (ConsoleMenu) – The menu to which this item belongs
- should_exit (bool) – Whether the menu should exit once this item’s action is done
- menu_char (str) – The character used to select this menu item. Optional - defaults to None.
-
get_submenu
()[source]¶ We unwrap the submenu variable in case it is a reference to a method that returns a submenu
-
set_menu
(menu)[source]¶ Sets the menu of this item. Should be used instead of directly accessing the menu attribute for this class.
Parameters: menu (ConsoleMenu) – the menu