"Ulrich Schöbel" <ulrich@outvert.com> wrote in message
news:pan.2006.02.25.21.33.49.509055@outvert.com...
> Am Sat, 25 Feb 2006 23:26:02 +0200 schrieb Ulrich Schöbel:
>
>> Hi all,
>>
>> 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"]
Should it be
foreach x {e B Y} y {day mon year} {
set [set y] [clock format [clock seconds] -format %$x]
}
puts "$day $mon $year" ;# just to test (worked for me)
interesting to see it stuck on my bday ;)
>> 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?
>>
>> Kind regards
>>
>> Ulrich
>
> Forgot to say:
>
> Tcl/Tk 8.4.12 on Linux 2.6.12
>
Received on Sun Apr 30 02:15:54 2006