Stack¶
A container that holds multiple named children but only renders the active one. Used for tabbed interfaces where switching between views should preserve child state.
Implements¶
- CompositeWidget tag
Constructors¶
create¶
Parameters¶
- p: WidgetParent tag
Returns¶
- Stack tag^
Public Behaviours¶
set_input_actor¶
Store a reference to the InputActor for focus scope gating.
Parameters¶
- input: InputActor tag
add_child¶
Register a child by name. The first child added becomes active. If the Stack already has dimensions, the child is resized immediately. Non-active children have their scope disabled if input_actor is set.
Parameters¶
show¶
Switch the active child. No-op if the name doesn't exist or is already active.
Parameters¶
- name: String val
receive_grid¶
Store all children's grids, but only trigger a deferred render if the grid came from the active child.
Parameters¶
resize¶
Resize ALL children to full container size, not just the active one.
Parameters¶
trigger_render¶
receive_key¶
Parameters¶
- key: KeyEvent val
receive_focus¶
receive_blur¶
set_debug_bg¶
be set_debug_bg(
color: (Default val | Black val | Red val |
Green val | Yellow val | Blue val |
Magenta val | Cyan val | White val |
BrightBlack val | BrightRed val | BrightGreen val |
BrightYellow val | BrightBlue val | BrightMagenta val |
BrightCyan val | BrightWhite val | Rainbow val))
Parameters¶
- color: (Default val | Black val | Red val | Green val | Yellow val | Blue val | Magenta val | Cyan val | White val | BrightBlack val | BrightRed val | BrightGreen val | BrightYellow val | BrightBlue val | BrightMagenta val | BrightCyan val | BrightWhite val | Rainbow val)
Public Functions¶
state¶
Returns¶
- WidgetState ref
render¶
Return the active child's grid directly. If no active child, return the background.
Returns¶
- Grid val
render_background¶
Returns¶
- Grid val
register_child¶
Parameters¶
- widget: Widget tag
Returns¶
- None val
render_and_send¶
Returns¶
- None val