Spinbox
A value entry with up / down steppers. TSpinbox is the themed version
(preferred); Spinbox is the classic one.
Example
const qty = app.TSpinbox({ from: 1, to: 99 });
qty.value = '1';
qty.pack.configure({ padx: 16, pady: 8 });
console.log(parseInt(qty.value, 10));
Options
| Option | Type | Description |
|---|---|---|
from / to |
number | The value range. |
increment |
number | Step size for the arrows. |
values |
list | A fixed set of choices instead of a numeric range. |
format |
string | A printf-style format for the displayed number. |
state |
string | 'normal', 'readonly', or 'disabled'. |
wrap |
boolean | Whether the value wraps past the ends. |
textVariable |
a *Var |
Bind the current value. |
style |
string | A ttk style name (TSpinbox only). |
Methods
Spinbox shares the Entry text methods:
| Method | Description |
|---|---|
value |
Property: get or set the current value (a string). |
insert / delete / clear / getText |
As for Entry. |
Plus the inherited widget methods — see Widget basics.