BEGIN { require Tk; import Tk; } $top = tkinit; $b = Checkbutton::new($top, "-text" => "click button 3 for value", "-variable" => $foo, "-onvalue" => "yep", "-offvalue" => "nope"); tkbind($b, "<3>", "::printvalue"); tkpack $b; tkmainloop; sub printvalue { print "checkbutton value is $foo\n"; }