Description: |
The tklib::dateentry is a nice widget to select a date, and I can
readily query the date via the 'get' method.
However there currently is no convenient way to *set* the date (eg. at
program start to the selection of the last run).
I can use the methods of the entry, but this does not update the
calendar display:
package require widget::dateentry
pack [widget::dateentry .d -dateformat %Y-%m-%d]
.d configure -state normal
.d delete 0 end
.d insert end 2020-10-10
.d configure -state readonly
The dateentry now shows "2020-10-10", but when you open the calendar, it
shows todays' month instead of October 2020.
Using the -textvariable method is not reliable, it seems to be ignored
or interfers with the internals of the widget.
Proposed patch attached.
|