set choice 0 set c 0 foreach i {red green blue white brown yellow} { radiobutton .$i -text $i -variable choice \ -value [expr $c % 2] -bg grey77 pack .$i -side left -fill y incr c } label .l -textvariable choice pack .l -side left -expand y -fill both proc tick {} { global choice if {$choice} { set choice 0 } else { set choice 1 } after 500 tick } tick