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_  checked
Checkbox.Style

image

class

class gui.Checkbox():

  implements WindowChildView

  constructor (

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

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

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

    ~style: style :: 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],

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

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

  )

 

property

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

Creates a checkbox. See View.LabelString for information about keyboard mnemonics in label.

The function call action(now_checked) is performed when the checkbox is clicked by a user, where now_checked indicates the newly toggled state of the checkbox.

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

See Geometry Management for information about ~margin, ~min_size, and ~stretch.

The ~window_callbacks argument configures callbacks that are common to all WindowChildViews. See WindowCallbacks for more information.

enumeration

enum gui.Checkbox.Style

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