On this page:
HPanel
VPanel
Group  Panel
Tabs  Panel
Tabs  Panel.at_  selection
HPanel.Style
HPanel.Style.deleted
HPanel.Style.border
HPanel.Style.vscroll
HPanel.Style.hscroll
HPanel.Style.auto_  vscroll
HPanel.Style.auto_  hscroll
HPanel.Style.hide_  vscroll
HPanel.Style.hide_  hscroll
VPanel.Style
VPanel.Style.deleted
VPanel.Style.border
VPanel.Style.vscroll
VPanel.Style.hscroll
VPanel.Style.auto_  vscroll
VPanel.Style.auto_  hscroll
VPanel.Style.hide_  vscroll
VPanel.Style.hide_  hscroll
Group  Panel.Style
Group  Panel.Style.deleted
Tabs  Panel.Style
Tabs  Panel.Style.deleted
Tabs  Panel.Style.no_  border
Tabs  Panel.Style.can_  reorder
Tabs  Panel.Style.can_  close
Tabs  Panel.Style.new_  button
Tabs  Panel.Style.flat_  portable
8.13.0.9

5 Panels and Tabs🔗ℹ

class

class HPanel():

  implements View

  constructor (

    ~alignment: alignment :: MaybeObs.of(Alignment) = [#'center, #'top],

    ~styles: styles :: MaybeObs.of(List.of(HPanel.Style)) = [],

    ~is_enabled: is_enabled :: MaybeObs.of(Boolean) = #true,

    ~spacing: spacing :: MaybeObs.of(SpacingInteger) = 0,

    ~margin: margin :: MaybeObs.of(Margin) = [0, 0],

    ~min_size: min_size :: MaybeObs.of(Size) = [#false, #false],

    ~stretch: stretch :: MaybeObs.of(Stretch) = [#true, #true],

    child :: MaybeObs.of(View), ...

  )

 

class

class VPanel():

  implements View

  constructor (

    ~alignment: alignment :: MaybeObs.of(Alignment) = [#'center, #'top],

    ~styles: styles :: MaybeObs.of(List.of(VPanel.Style)) = [],

    ~is_enabled: is_enabled :: MaybeObs.of(Boolean) = #true,

    ~spacing: spacing :: MaybeObs.of(SpacingInteger) = 0,

    ~margin: margin :: MaybeObs.of(Margin) = [0, 0],

    ~min_size: min_size :: MaybeObs.of(Size) = [#false, #false],

    ~stretch: stretch :: MaybeObs.of(Stretch) = [#true, #true],

    child :: MaybeObs.of(View), ...

  )

Creates a panel that arranges the child views horizontally or vertically, respectively.

class

class GroupPanel():

  implements View

  constructor (

    label :: MaybeObs.of(LabelString),

    ~alignment: alignment :: MaybeObs.of(Alignment) = [#'center, #'top],

    ~styles: styles :: MaybeObs.of(List.of(GroupPanel.Style)) = [],

    ~is_enabled: is_enabled :: MaybeObs.of(Boolean) = #true,

    ~spacing: spacing :: MaybeObs.of(SpacingInteger) = 0,

    ~margin: margin :: MaybeObs.of(Margin) = [0, 0],

    ~min_size: min_size :: MaybeObs.of(Size) = [#false, #false],

    ~stretch: stretch :: MaybeObs.of(Stretch) = [#true, #true],

    child :: MaybeObs.of(View), ...

  )

Creates a vertical panel that shows grouping under label.

class

class TabsPanel():

  implements View

  constructor (

    choices :: MaybeObs.of(List),

    ~selection: selection :: MaybeObs.of(Any),

    ~action: action :: Function.of_arity(3) = set_selection,

    ~choice_to_label: choice_to_label :: Function.of_arity(1) = values,

    ~choice_equal: choice_equal :: Function.of_arity(2) = (_ == _),

    ~alignment: alignment :: MaybeObs.of(Alignment) = [#'center, #'top],

    ~styles: styles :: MaybeObs.of(List.of(TabsPanel.Style)) = [],

    ~is_enabled: is_enabled :: MaybeObs.of(Boolean) = #true,

    ~spacing: spacing :: MaybeObs.of(SpacingInteger) = 0,

    ~margin: margin :: MaybeObs.of(Margin) = [0, 0],

    ~min_size: min_size :: MaybeObs.of(Size) = [#false, #false],

    ~stretch: stretch :: MaybeObs.of(Stretch) = [#true, #true],

    child :: MaybeObs.of(View), ...

  )

 

property

property (tabs :: TabsPanel).at_selection :: Obs

Creates a tab panel where choices provides the number and identity of choices, and selection determines which of the tabs is selected.

If selection is not an observable, then an observable at_selection is created with initial value selection. Otherwise, at_selection is selection. A observable derived from at_selection can be obtained from the TabsPanel.at_selection property.

The choice_to_label function converts an item in choices to a label to be shown for the tab, and choice_equal defines equality for choice identities. By default, choices is expected to be a list of LabelString, since choice_to_label is the identity function.

When the tab selection changes, action is called as

action(what :: Any.of(#'select, #'new, #'close, #'reorder),

       choices :: List,

       selected :: maybe(Any))

where what describes the action, choices is the list of choices at the time of the action, and selected is the tab (if any) selected after the action. The default set_selection function corresponds to

fun (_, _, selected):

  at_selection.value := selected

To change the content of a TabsPanel based on its selection, supply a child that is an observable derived from one supplied as selection.

A panel style option (the same for horizontal and vertical panels).

enumeration

enum GroupPanel.Style:

  deleted

A group panel style option.

A tab panel style option.