3.3.5 Controls
3.3.5.1 Button
3.3.5.2 Checkbox
3.3.5.3 Choice
3.3.5.4 Radio  Choice
3.3.5.5 List  Choice
3.3.5.6 Table
3.3.5.7 Slider
3.3.5.8 Progress
3.3.5.9 Input
3.3.5.10 Label
3.3.5.11 Image
3.3.5.12 Spacer
On this page:
List  Choice
List  Choice.at_  selection
List  Choice.Style  Symbol
List  Choice.Style  Symbol.horizontal_  label
List  Choice.Style  Symbol.vertical_  label

image

class

class gui.ListChoice():

  implements WindowChildView

  constructor (

    choices :: ObsOrValue.of(List),

    ~choice_to_label: choice_to_label :: Any -> Any = values,

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

    ~selection: selection :: ObsOrValue.of(Any) = #false,

    ~action: action :: Any -> ~any = values,

    ~label: label :: ObsOrValue.of(maybe(View.LabelString)) = #false,

    ~styles: styles :: List.of(ListChoice.StyleSymbol) = [],

    ~enable: enable :: ObsOrValue.of(Boolean) = #true,

    ~font : font :: draw.Font = View.normal_control_font,

    ~margin: margin :: ObsOrValue.of(View.Margin) = [2, 2],

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

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

    ~window_callbacks: window_callbacks :: maybe(WindowCallbacks) = #false

  )

 

property

property (chc :: gui.ListChoice).at_selection :: Obs

Like gui.Choice, but presented as a list box instead of a popup menu. The ListChoice view is a simplified version of the Table view.

A list choice style option:

  • #'horizontal_label: When the list-choice control has a label, show it to the left of the control. Horizontal label placement is the default if #'vertical_label is not specified, and #'horizontal_label and #'vertical_label are mutually exclusive.

  • #'vertical_label: When the list-choice control has a label, show it above the control.