Re: Bug in spinbox
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Bug in spinbox

From: Jeff Hobbs <jeffh@activestate.com>
Date: Sun Feb 26 2006 - 20:32:39 CET

Ulrich Schöbel wrote:
> end of January I started the development of a prototype GUI
> as a starting point for a new program. Part of the GUI is a
> simple date chooser. Everything was fine, the customer was
> happy with it. After having written the innards of this
> program I retested it and, surprise, it didn't work correctly
> anymore: The date chooser came up with the correct day and
> year, but the month was still January.
>
> Here's a short excerpt:
>
> # Initialisation of a couple of variables right at the top
> set months {January February March April May June July August September October November December}
> foreach {day mon year} [clock format [clock seconds] -format "%e %B %Y"]
> break
> #
> # more variables being set
>
> # part of the GUI (date chooser)
> spinbox .f1.f11.dat.day -from 1 -to 31 \
> -width 2 -state readonly -textvariable day
> spinbox .f1.f11.dat.mon -values $months \
> -width 9 -state readonly -textvariable mon
> spinbox .f1.f11.dat.year -from 1980 -to 2036 \
> -width 4 -state readonly -textvariable year
>
> After packing and displaying it, it shows 25. January 2006 as
> the current date. Day and year, configured with from/to work
> correctly, mon configured with -values insists on the first
> value of the list. When Iset the month after the definition
> of th spinbox, everything is ok.
>
> In my eyes this is a bug of spinbox, at least an inconsistency.
>
> Should I file a bug report?

I don't know that I would call this a bug, as the spinbox clearly
doesn't document this as the stated behavior. The quickest fix
is to set the day/mon/year after instantiating the spinboxes, as
that makes everything work correctly. You can file a bug report,
but I would mark it as an RFE.

-- 
   Jeff Hobbs, The Tcl Guy
   http://www.ActiveState.com/, a division of Sophos
Received on Sun Apr 30 02:16:12 2006