• tklib::dateentry is missing a 'set' method

    From Ralf Fassel@21:1/5 to All on Mon Apr 17 16:32:53 2023
    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.

    I would provide a patch to tklib, but I don't know snit well enough, so
    has anyone here a hint on how to provide the equivalent of 'dateentry::set' ?

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Mon Apr 17 17:58:51 2023
    Am 17.04.2023 um 17:23 schrieb Ralf Fassel:
    * Ralf Fassel <[email protected]>
    | 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.

    | I would provide a patch to tklib, but I don't know snit well enough, so
    | has anyone here a hint on how to provide the equivalent of 'dateentry::set' ?

    https://core.tcl-lang.org/tklib/tktview/fcce9df1f41789d9e19570028dc5fb518d3bc280

    R'

    Hi Ralf,
    your extension sounds reasonable, thank you for that.
    I may put it into a fossil branch or you may ask for commit access and
    do it on your own.

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Mon Apr 17 17:23:59 2023
    * Ralf Fassel <[email protected]>
    | 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.

    | I would provide a patch to tklib, but I don't know snit well enough, so
    | has anyone here a hint on how to provide the equivalent of 'dateentry::set' ?

    https://core.tcl-lang.org/tklib/tktview/fcce9df1f41789d9e19570028dc5fb518d3bc280

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Tue Apr 18 13:52:25 2023
    * Harald Oehlmann <[email protected]>
    | > | I would provide a patch to tklib, but I don't know snit well enough, so
    | > | has anyone here a hint on how to provide the equivalent of 'dateentry::set' ?
    | > https://core.tcl-lang.org/tklib/tktview/fcce9df1f41789d9e19570028dc5fb518d3bc280

    | Hi Ralf,
    | your extension sounds reasonable, thank you for that.
    | I may put it into a fossil branch [...]

    It would be nice if you could do that.

    | [...] or you may ask for commit access and do it on your own.

    Whom would I have to ask? There are a few more topics with the
    dateentry (callback invoked *before* the widget has the new date,
    -textvariable seems not to work as documented) ...

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)