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)