Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

spinbox bug?

11 views
Skip to first unread message

Hanz

unread,
Aug 27, 2008, 7:58:12 AM8/27/08
to
Hi All,

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

suchenwi

unread,
Aug 27, 2008, 8:47:34 AM8/27/08
to

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

Hanz

unread,
Aug 27, 2008, 9:16:16 AM8/27/08
to
Hi suchenwi,

>
> 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
Thanks, yes, I tried this, but to my surprize you can see still funny
behavior around with the '09' list element, as if it is somehow still
inspected. Still, I guess this is the only solution...

Cheers, Hans

suchenwi

unread,
Aug 27, 2008, 9:28:34 AM8/27/08
to

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.

Hanz

unread,
Aug 27, 2008, 10:51:26 AM8/27/08
to
Right, I had a validation command still checking the field for
non-integer user entry, and indeed the 'string is integer 09' fails. Tricky!

Thanks, Hans

0 new messages