Scale
A themed slider for choosing a number in a range.
Live preview
Drag the slider; the Theme switcher in the toolbar restyles it live:
Live preview. In the Player's built-in docs viewer (
scriptweaver --help), this rendersScaleas a live, theme-aware widget you can interact with.
Example
const level = app.Scale({ from: 0, to: 100, orient: 'horizontal' });
level.value = 25;
level.pack.configure({ fill: 'x', padx: 16, pady: 8 });
level.bind('<B1-Motion>', () => console.log(level.value));
Options
| Option | Type | Description |
|---|---|---|
from / to |
number | The range ends. |
orient |
string | 'horizontal' or 'vertical'. |
length |
number | Pixel length of the trough. |
variable |
a *Var |
Bind the current value. |
style |
string | A ttk style name (TScale only). |
The raw Tk scale (via __native_tcl) adds label, showValue, tickInterval, and resolution.
Methods
| Method | Description |
|---|---|
value |
Property: get or set the current value (a number). |
Plus the inherited widget methods — see Widget basics.