
|
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 | ) |
|
|
|
|
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:
#'horizontal: Creates a horizontal slider, where
#'vertical and #'horizontal are mutually exclusive.
#'vertical: Creates a vertical slider.
#'plain: Creates an unadorned slider where the slider’s
numerical value is not reported to the user.
#'horizontal_label: When the slider has a label, show
it to the left of the slider. 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 slider has a label, show it
above the control.