MenuItem¶
- class cursesmenu.items.MenuItem(text, menu=None, *, should_exit=False, override_index=None)[source]¶
The base class for menu items.
Is displayed in a basic manner and does nothing when selected.
- Parameters:
text (
str
) – The text representing this menu itemshould_exit (
bool
) – Whether the menu should exit when this item is selectedmenu (
Optional
[Any
]) – The menu that owns this item
- action()[source]¶
Do the main action for the item.
If you’re just writing a simple subclass, you shouldn’t need set_up or clean_up. The menu just calls them in order. They are provided so you can make subclass hierarchies where the superclass handles some setup and cleanup for its subclasses.
- Return type:
None