Scale

A slider for choosing a number in a range. TScale is the themed version (preferred); Scale is the classic one (which can also show a label and tick marks).

Example

const level = app.TScale({ 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 classic Scale 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.

See also