1
0
Fork 0
This repository has been archived on 2019-12-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
arduinisten/arduino-0018-windows/hardware/tools/avr/share/iwidgets4.0.1/demos/spinner
2010-03-30 21:53:44 +02:00

28 lines
767 B
Text

# ----------------------------------------------------------------------
# DEMO: spinner in [incr Widgets]
# ----------------------------------------------------------------------
package require Iwidgets 4.0
option add *textBackground seashell
proc spinMonth {win step} {
set months {
January February March April
May June July August September
October November December
}
set index [expr [lsearch $months [$win get]] + $step]
if {$index < 0} {set index 11}
if {$index > 11} {set index 0}
$win delete 0 end
$win insert 0 [lindex $months $index]
}
iwidgets::spinner .sm -labeltext "Month:" -width 10 -fixed 10 \
-decrement {spinMonth .sm -1} -increment {spinMonth .sm 1}
pack .sm
.sm insert 0 "January"