I'm using a spinbox to control a timer. For the hour setting I would
like numbers 00, 01, .., 23. So I use options:
-from 0 -to 23 -increment 1 -width 2 -format "%02.0f"
However, when operating the spinbox arrows, I can go up to 08, but from
there instead of going to 09 the box resets to 00.
Adding a validation command which always returns 1 does not help.
Changing the format to "%2.0f" avoids the problem, possibly because
then values like '09' which can be interpreted as a bad octal do not occur.
-- Hans
To avoid this yet another incarnation of the octal problem, you might
just give a values list:
pack [spinbox .s -values {
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21
22 23
}]
instead of -from, -to, -format, -increment
Cheers, Hans
If you do any arithmetic with the strings 08 and 09, you'd better
[scan] the numeric value out of them before doing that. Just spinning
over them shows no problem here.
Thanks, Hans