menus.esc module¶
Provides ESC Menu functionality.
-
class
menus.esc.
ListESCMenu
(data=None, select_callback=None, build_callback=None, close_callback=None, description=None, title=None, title_color=Color(255, 255, 255, 255), fill=True, parent_menu=None, items_per_page=5)[source]¶ Bases:
menus.esc.PagedESCMenu
Creates a list-like ESC menu.
Navigation options are added automatically.
-
__init__
(data=None, select_callback=None, build_callback=None, close_callback=None, description=None, title=None, title_color=Color(255, 255, 255, 255), fill=True, parent_menu=None, items_per_page=5)[source]¶ Initialize the object.
Parameters: - data (iterable|None) – See
menus.base._BaseMenu.__init__()
. - select_callback (callable|None) – See
menus.base._BaseMenu.__init__()
. - build_callback (callable|None) – See
menus.base._BaseMenu.__init__()
. - close_callback (callable|None) – See
menus.base._BaseMenu.__init__()
. - description (str|None) – See
SimpleESCMenu.__init__()
. - title (str|None) – See
SimpleESCMenu.__init__()
. - title_color (Color) – See
SimpleESCMenu.__init__()
. - fill (bool) – See
PagedESCMenu.__init__()
. - parent_menu (_BaseMenu) – See
PagedESCMenu.__init__()
. - items_per_page (int) – Number of options that should be displayed on a single page (5 is the maximum).
- data (iterable|None) – See
-
-
class
menus.esc.
ListESCOption
(text, highlight=True, enumerated=True)[source]¶ Bases:
menus.esc.PagedESCOption
Provides options for
ListESCMenu
objects.
-
class
menus.esc.
PagedESCMenu
(data=None, select_callback=None, build_callback=None, close_callback=None, description=None, title=None, title_color=Color(255, 255, 255, 255), fill=True, parent_menu=None)[source]¶ Bases:
menus.esc.SimpleESCMenu
,menus.base._PagedMenuBase
Create menus with an unlimited number of options.
Navigation options will be added automatically.
-
__init__
(data=None, select_callback=None, build_callback=None, close_callback=None, description=None, title=None, title_color=Color(255, 255, 255, 255), fill=True, parent_menu=None)[source]¶ Initialize the object.
Parameters: - data (iterable|None) – See
menus.base._BaseMenu.__init__()
. - select_callback (callable|None) – See
menus.base._BaseMenu.__init__()
. - build_callback (callable|None) – See
menus.base._BaseMenu.__init__()
. - close_callback (callable|None) – See
menus.base._BaseMenu.__init__()
. - description (str|None) – See
SimpleESCMenu.__init__()
. - title (str|None) – See
SimpleESCMenu.__init__()
. - title_color (Color) – See
SimpleESCMenu.__init__()
. - fill (bool) – If True the menu will always have the same size by filling unused options.
- parent_menu (_BaseMenu) – A menu that will be displayed when hitting ‘Back’ on the first page.
- data (iterable|None) – See
-
-
class
menus.esc.
PagedESCOption
(text, value=None, highlight=True, selectable=True)[source]¶ Bases:
menus.base._BaseOption
Display an enumerated option.
-
class
menus.esc.
SimpleESCMenu
(data=None, select_callback=None, build_callback=None, close_callback=None, description=None, title=None, title_color=Color(255, 255, 255, 255))[source]¶ Bases:
menus.base._BaseMenu
This class creates basic ESC menus.
-
__init__
(data=None, select_callback=None, build_callback=None, close_callback=None, description=None, title=None, title_color=Color(255, 255, 255, 255))[source]¶ Initialize the object.
Parameters: - data (iterable|None) – See
menus.base._BaseMenu.__init__()
. - select_callback (callable|None) – See
menus.base._BaseMenu.__init__()
. - build_callback (callable|None) – See
menus.base._BaseMenu.__init__()
. - close_callback (callable|None) – See
menus.base._BaseMenu.__init__()
- description (str|None) – A description that is displayed under the title.
- title (str|None) – A title that is displayed at the top of the menu.
- title_color (Color) – The color of the title.
- data (iterable|None) – See
-
-
class
menus.esc.
SimpleESCOption
(choice_index, text, value=None, highlight=True, selectable=True)[source]¶ Bases:
menus.base._BaseOption
Provides options for
SimpleESCMenu
objects.