$mw -> Checkbutton ( -activebackground => "white", -command => &react ("\"$x\_$y\""); -command => print "hi" # <= this is a change ) -> grid ( -row => $x, -column => $y ); .... sub react { print "$_[0]\n"; }