wm title . "Spinner Example" set months {Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec} ## ## Helper procs ## proc blockInput {} {return 0} proc spinMonth {direction} { global months set index [expr [lsearch $months [.sm get]] + $direction] if {$index < 0} {set index 11} if {$index > 11} {set index 0} .sm delete 0 end .sm insert 0 [lindex $months $index] return } ##========================================================= ## Create a spinner iwidget ##========================================================= ## iwidgets::spinner .sm \ -labeltext "Enter Month : " \ -width 5 \ -fixed 3 \ -validate blockInput \ -decrement {spinMonth -1} \ -increment {spinMonth 1} .sm insert 0 [clock format [clock seconds] -format "%b"] pack .sm \ -padx 10 \ -pady 10