Skip to content

TabBar

[Source]

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.

actor tag TabBar is
  Widget tag

Implements


Constructors

create

[Source]

new tag create(
  p: WidgetParent tag,
  callback: {(String val): None} val,
  orientation: (TabHorizontal val | TabVertical val) = reference)
: TabBar tag^

Parameters

Returns


Public Behaviours

add_tab

[Source]

Append a tab and re-render.

be add_tab(
  key: String val,
  label: String val)

Parameters


set_active

[Source]

Set the active tab by key without firing the callback. Also moves highlight to match. No-op if key not found.

be set_active(
  key: String val)

Parameters


receive_focus

[Source]

be receive_focus()

receive_blur

[Source]

be receive_blur()

receive_key

[Source]

be receive_key(
  key: KeyEvent val)

Parameters


resize

[Source]

be resize(
  w: USize val,
  h: USize val)

Parameters


trigger_render

[Source]

be trigger_render()

set_debug_bg

[Source]

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


Public Functions

state

[Source]

fun ref state()
: WidgetState ref

Returns


render

[Source]

fun ref render()
: Grid val

Returns


render_and_send

[Source]

fun ref render_and_send()
: None val

Returns