TabBar¶
A focusable, keyboard-navigable tab bar. Displays a row (horizontal) or column (vertical) of labelled tabs. Arrow keys move the highlight; Enter/Space activates the highlighted tab and fires the callback.
Implements¶
- Widget tag
Constructors¶
create¶
new tag create(
p: WidgetParent tag,
callback: {(String val): None} val,
orientation: (TabHorizontal val | TabVertical val) = reference)
: TabBar tag^
Parameters¶
- p: WidgetParent tag
- callback: {(String val): None} val
- orientation: (TabHorizontal val | TabVertical val) = reference
Returns¶
- TabBar tag^
Public Behaviours¶
add_tab¶
Append a tab and re-render.
Parameters¶
set_active¶
Set the active tab by key without firing the callback. Also moves highlight to match. No-op if key not found.
Parameters¶
- key: String val
receive_focus¶
receive_blur¶
receive_key¶
Parameters¶
- key: KeyEvent val
resize¶
Parameters¶
trigger_render¶
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¶
Returns¶
- Grid val
render_and_send¶
Returns¶
- None val