Improved handling of case where child is killed by a signal
[tcl-tlc.git] / scripts / spinint.itcl
blobe25e3659390a400530d134e0d1a628fecd9413f7
1 # vim: ft=tcl foldmarker=<<<,>>>
3 class tlc::Spinint {
4 inherit tlc::Spinner
6 constructor {args} {} {}
8 public {
9 variable min 0 {recalc}
10 variable max 10 {recalc}
11 variable step 1 {recalc}
14 private {
15 method recalc
19 body tlc::Spinint::constructor {args} {
20 eval itk_initialize $args
21 # set up the list with the min / max
22 recalc
25 body tlc::Spinint::recalc {} {
26 if {![string is integer min] || ![string is integer max] || ![string is integer step]} {
28 if {$min > $max} {
29 set hold $min
30 set min $max
31 set max $hold
33 set choices ""
34 for {set i $min} {$i <= $max} {incr i $step} {
35 lappend choices $i
37 } else {
38 error "Spinint requires integer values for min, max and step.\nValues passed were: min: ($min)\tmax: ($max)\tstep: ($step)"