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:
Checkbox
Checkbox.at_  is_  checked
Checkbox.Style

image

class

class gui.Checkbox():

  implements WindowChildView

  constructor (

    label :: ObsOrValue.of(View.LabelString),

    ~is_checked: is_checked :: ObsOrValue.of(Boolean) = #false,

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

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

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

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

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

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

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

  )

 

property

property (cb :: gui.Checkbox).at_is_checked :: Obs.of(Boolean)

Creates a checkbox. When rendered, the function call action(now_checked) is performed when the checkbox is clicked, where now_checked indicates the state of the checkbox.

The Checkbox.at_is_checked property returns an observable that is updated whenever the checkbox’s state changes through an action (as also reported via action) or via is_checked as an observable.

enumeration

enum gui.Checkbox.Style

A checkbox style option. No options are supported, currently.