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:
Slider.Style
Slider.Style.horizontal
Slider.Style.vertical
Slider.Style.plain
Slider.Style.horizontal_  label
Slider.Style.vertical_  label

image

class

class gui.Slider():

  implements WindowChildView

  constructor (

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

    ~value: value :: ObsOrValue.of(View.PositionInt) = 0,

    ~min_value: min_value :: ObsOrValue.of(View.PositionInt) = 0,

    ~max_value: max_value :: ObsOrValue.of(View.PositionInt) = 100,

    ~action: action :: View.PositionInt -> ~any = values,

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

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

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

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

    ~styles: styles :: List.of(Slider.Style) = [#'horizontal],

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

  )

 

property

property (sldr :: gui.Slider).at_value :: Obs.of(PositionInt)

Creates a slider. When rendered, the function call action(now_val) is performed when the slider is changed, where now_val indicates the value of the slider.

The Slider.at_value property returns an observable that is updated whenever the slider’s value changes through an action (as also reported via action) or via value as an observable.

The styles list must include one of #'horiziontal and #'vertical.

A slider style option.