----------------------------
Due to the changes in the clock command in tcl 8.5 the calendar widget
now gives every month 31 days.
The fix is to change iwidgets::Calendar::_layout with the following:
Find the foreach lastday section and replace it with:
foreach lastday {31 30 29 28} {
if {[catch {clock scan "$month/$lastday/$year"} newdate] == 0}
{
set datestring [clock format $newdate -format "%m/%d/%Y"]
set splist [split $datestring "/"]
if { [lindex $splist 0] == $month } {
break
}
}
}
Thanks,
Mark Alston
When you visit http://sf.net/projects/incrtcl , it shows
davygrvy, dgp, hobbs, marhar, mgbacke, mmclennan, smithc, welch
as the list of maintainers. When you go into the bug tracking part of
the site, you see
1965339 iwidgets::calendar : -startday doesn`t updates the day label
* 2008-05-16 13:14 5 davygrvy aubinroy
which says that maintainer davygrvy was assigned your bug report.
Interestingly enough, the example shown on the page shows an example
of using -startday - and the example explicitly defines the days
labels.
When I look at the calendar.itk code, the first thing I notice is that
it is based on a calendar widget that first appeared in Michael
McLennan's Effective Tcl book.
Next, when I search the code, I see this code:
# PRIVATE METHOD: _days
#
# Used to rewite the days of the week label just below the month
# title string. The days are given in the -days option.
# ------------------------------------------------------------------
itcl::body iwidgets::Calendar::_days {{wmax {}}} {
if {$wmax == {}} {
set wmax [winfo width $itk_component(page)]
}
set col 0
set bottom [expr {[lindex [$itk_component(page) bbox title
buttons] 3] + 7}]
foreach dayoweek $itk_option(-days) {
set x0 [expr {$col*($wmax/7)}]
set x1 [expr {($col+1)*($wmax/7)}]
$itk_component(page) create text \
[expr {(($x1 - $x0) / 2) + $x0}] $bottom \
-anchor n -text "$dayoweek" \
-fill $itk_option(-foreground) \
-font $itk_option(-dayfont) \
-tags [list days text]
incr col
}
}
So it sort of looks, to me, as if it is expected that if you supply a -
startday that you will also supply a -days argument as well. But maybe
I am misreading the code.
Except that that isn't my bug report at all. If you notice my bug
report is related to the calandar giving all months 31 days caused by
the change in behavior with the tcl 8.5 clock command. This is quite
certainly not desired behavior and unrelated to the startday issue.
I'll look at that issue later and can maybe fix that one as well.
Moreover, I tried to email several of the developers and have yet to
get a reponse (over a week).
Obviously a simple error/misread on your part but it still doesn't
address who is watching iwidgets.
If you browse CVS you will see that one change was made 6 weeks ago
(to disjointlistbox and one 15 months ago to shell. Many of us (I
assume) have large applications that use itcl and iwidgets
throughout. It would be nice if someone was keeping it up to date so
that it would at least work with tcl 8,5. I don't mind being one of
those people but I can't commit my fixes since I can't reach the
developers.
So far I have posted three separate fixes to broken datefield and
calendar widgets but have seen or heard no activity on this front.
Doesn't really matter to me since I can keep maintaining it for myself
I just wanted to see if the reponsible persons might read this
newsgroup more often than their sourceforce mailing lists.
Mark Alston