Tk Library Source Code

View Ticket
Login
Ticket UUID: fcce9df1f41789d9e19570028dc5fb518d3bc280
Title: tklib::dateentry is missing a 'set' method
Type: RFE Version: trunk (dateentry 0.93)
Submitter: ralfixx Created on: 2023-04-17 15:20:16
Subsystem: tklib :: widget :: dateentry Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2024-05-05 13:07:28
Resolution: None Closed By: nobody
    Closed on:
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.

Attachments: