#!/usr/bin/env wish

proc change {} {
  global color
  .current configure -text $color -bg $color
}

frame .f
set color "blue"
foreach i {"blue" "red" "green"} {
  radiobutton .$i -text $i -value $i -variable color -command change -anchor w
  pack .$i -anchor w -side left -in .f
}
pack .f
label .current -text $color -bg $color
pack .current -fill x 

bind . <Key-q> exit

