state
dev_tool.tui.components.state
State
dataclass
A data class representing the menu state.
This class tracks the current menu, selected index, row, and offset.
menu
instance-attribute
index
instance-attribute
row
instance-attribute
offset
instance-attribute
tab = 0
class-attribute
instance-attribute
StateManager
A class for managing TUI state and navigation stack.
The constructor for the StateManager class.
Source code in dev_tool/tui/components/state.py
stack = [State(menu=menu, index=0, row=0, offset=0, tab=0)]
instance-attribute
current
property
index
property
writable
menu
property
offset
property
writable
root
property
row
property
writable
tab
property
writable
go_back
is_root_with_tabs
A method that checks if currently at root level with tabs.
Returns:
-
bool–True if at root with tabs, False otherwise.
is_tabs
A method that checks if the current menu has tabs.
Returns:
-
bool–True if the menu has tabs, False otherwise.
Source code in dev_tool/tui/components/state.py
push_menu
A method that pushes a new menu onto the stack.
Parameters:
-
menu(Menu) –The new menu.