• Re: date and time picker

    From Gerhard Reithofer@21:1/5 to Mole Cool on Thu May 25 17:32:12 2023
    Hi Mole,
    looks very good but I need also athe time part even with seconds.

    Bye,
    Gerhard

    On Wed, 10 May 2023, Mole Cool wrote:

    Hello Gerhard, I could provide a single Date Picker,
    looks similar to the Image here at https://m2.material.io/components/date-pickers#mobile-pickers
    Check the picture above the text ‚Mobile calendar pickers adapt to a device’s orientation‘.

    I show always the selected date on the left, the interface has NO entry, you must select year, month and the date.

    I would move the code to the wiki if you don‘t need a range as well :-)


    --
    Gerhard Reithofer - Techn. EDV Reithofer - http://www.tech-edv.co.at

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luc@21:1/5 to Gerhard Reithofer on Thu May 25 18:12:19 2023
    On Thu, 25 May 2023 17:32:12 +0200, Gerhard Reithofer wrote:

    Hi Mole,
    looks very good but I need also athe time part even with seconds.

    Bye,
    Gerhard


    I believe the following code does what you want. The key bindings
    don't work, but I don't always understand Tk. It seems to be a focus
    problem, I don't know.


    --------------------
    package require Tk
    package require Iwidgets

    wm title . "Say when"

    iwidgets::calendar .cal \
    -startday monday -days "M T W T F S S" \
    -outline black -weekendbackground #CCCCCC \
    -width 250 -height 200 \
    -command {set ::date [.cal get]}
    pack .cal -expand yes -fill both

    iwidgets::spinint .hour \
    -labeltext "Hour: " \
    -range {0 23} -wrap yes \
    -textvariable ::chosenhour

    pack .hour -expand yes -fill both
    bind .hour <Up> {puts "go up"}
    bind .hour <Down> {.hour down}

    iwidgets::spinint .minute \
    -labeltext "Minutes: " \
    -range {0 59} -wrap yes \
    -textvariable ::chosenminute
    pack .minute -expand yes -fill both

    iwidgets::spinint .seconds \
    -labeltext "Seconds: " \
    -range {0 59} -wrap yes \
    -textvariable ::chosensecond
    pack .seconds -expand yes -fill both

    iwidgets::buttonbox .bb \
    -padx 10 -pady 10
    .bb add Go -text "Go!" -command {puts "$::date at $::chosenhour:$::chosenminute:$::chosensecond"}
    pack .bb -expand yes -fill both

    .cal select today
    --------------------

    source:
    https://incrtcl.sourceforge.net/iwidgets/iwidgets/calendar.html https://incrtcl.sourceforge.net/iwidgets/iwidgets/spinint.html


    --
    Luc


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luc@21:1/5 to Luc on Thu May 25 18:22:18 2023
    On Thu, 25 May 2023 18:12:19 -0300, Luc wrote:

    I believe the following code does what you want.


    Ooops, bug!

    Please insert this after the last line:

    last -> .cal select today
    insert after -> set ::date [.cal get]


    --
    Luc


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gerhard Reithofer@21:1/5 to Luc on Mon May 29 15:38:11 2023
    On Thu, 25 May 2023, Luc wrote:
    Hi Luc,
    thx, will have a look at it :-)

    On Thu, 25 May 2023 17:32:12 +0200, Gerhard Reithofer wrote:

    Hi Mole,
    looks very good but I need also athe time part even with seconds.

    Bye,
    Gerhard


    I believe the following code does what you want. The key bindings
    don't work, but I don't always understand Tk. It seems to be a focus
    problem, I don't know.


    --------------------
    package require Tk
    package require Iwidgets

    [...]

    Bye,
    Gerhard

    --
    Gerhard Reithofer - Techn. EDV Reithofer - http://www.tech-edv.co.at

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