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:
Radio  Choice
Radio  Choice.at_  selection
Radio  Choice.Style
Radio  Choice.Style.vertical
Radio  Choice.Style.horizontal
Radio  Choice.Style.horizontal_  label
Radio  Choice.Style.vertical_  label

image

class

class gui.RadioChoice():

  implements WindowChildView

  constructor (

    choices :: List.of(String),

    ~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(RadioChoice.Style) = [#'vertical],

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

    ~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.RadioChoice).at_selection :: Obs

Like gui.Choice, but presented as radio buttons instead of a popup menu. Unlike gui.Choice, the choices list cannot be changed.

The styles list must include either #'vertical or #'horizontal.

A radio choice style option:

  • #'vertical: Arrange radio-button choices vertically. Vertical arrangement is the default if #'horzontal is not specified, and #'vertical and #'horizontal are mutually exclusive.

  • #'horizontal: Arrange radio-button choices horizontally.

  • #'horizontal_label: When the radio-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 radio-choice control has a label, show it above the control.