Skip to content

SpinBox

import { SpinBox, VerticalBox } from "std-widgets.slint";
export component Example inherits Window {
width: 200px;
height: 50px;
VerticalBox {
alignment: center;
SpinBox {
value: 42;
}
}
}
slint
spinbox example

Properties

enabled

bool default: true

You can’t interact with the spinbox if enabled is false.

has-focus

bool (out) default: false

Set to true when the spinbox currently has the focus.

value

int (in-out) default: 0

The value. Defaults to the minimum.

SpinBox {
value: 50;
}
slint

minimum

int default: 0

The minimum value.

SpinBox {
minimum: 10;
value: 11;
}
slint

maximum

int default: 100

The maximum value.

SpinBox {
maximum: 10;
value: 9;
}
slint

step-size

int default: 1

The size that is used on increment or decrement of value.

horizontal-alignment

enum TextHorizontalAlignment default: left

TextHorizontalAlignment

This enum describes the different types of alignment of text along the horizontal axis of a Text element.

  • left: The text will be aligned with the left edge of the containing box.
  • center: The text will be horizontally centered within the containing box.
  • right: The text will be aligned to the right of the containing box.

The horizontal alignment of the text.

Callbacks

changed(int)

Emitted when the value has changed because the user modified it

SpinBox {
changed(value) => {
debug("New value: ", value);
}
}
slint

© 2024 SixtyFPS GmbH