public class Slider extends Widget:
Integer slider widget.
The native backend forwards pointer presses and drags to setValueFromPoint, so the widget remains implemented in Klyn while only the platform event routing stays native.
slider = Slider(value=50, minimum=0, maximum=100, orientation=Slider.HORIZONTAL) slider.trackFillColor = Color(59, 142, 208, 1.0) slider.valueChanged += lambda(event: ValueChangedEvent): print(event.value)
| Modifier and Type | Member | Description |
|---|---|---|
| public static const | HORIZONTALHORIZONTAL as String = "horizontal" |
No summary. |
| public static const | VERTICALVERTICAL as String = "vertical" |
No summary. |
| public event | valueChangedvalueChanged as Event |
Emitted after the value changes. |
| Modifier and Type | Member | Description |
|---|---|---|
| public property | liveValueliveValue as Boolean: |
Whether the current value is displayed next to the thumb during drag. |
| public property | maximummaximum as Int = 100 |
Highest allowed value. |
| public property | minimumminimum as Int = 0 |
Lowest allowed value. |
| public property | orientationorientation as String = Slider.HORIZONTAL |
Slider orientation: `horizontal` or `vertical`. |
| public property | showTicksshowTicks as Boolean: |
Whether the slider paints graduations along its scale. |
| public property | showValuesshowValues as Boolean: |
Whether numeric values are painted near the ticks. |
| public property | tickIntervaltickInterval as Int: |
Distance between two tick marks and displayed values. |
| public property | trackFillColortrackFillColor as Color: |
Color used for the active track segment between `minimum` and `value`. |
| public property | valuevalue as Int: |
Current value, clamped between `minimum` and `maximum`. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Slider | Creates a slider with an explicit orientation and optional range. |
| public | Slider | Creates a slider with an initial value, range, and orientation. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | adjustValueByadjustValueBy(delta as Int) as Void: |
Adjusts the current value by a signed delta. |
| public | beginDragbeginDrag() as Void: |
Native backend hook called when a pointer drag starts on this slider. |
| public | clampValue | Clamps a value into the slider range. |
| public | endDragendDrag() as Void: |
Native backend hook called when a pointer drag ends on this slider. |
| public override | paintpaint(painter as Painter) as Void: |
Paints the slider track, optional scale, optional live value, and thumb. |
| public | setValuesetValue(value as Int) as Void: |
Sets the value and emits `valueChanged` when it changes. |
| public | setValueFromPoint | Updates the value from a window-relative pointer position. |