use Tkx; my $mw = Tkx::widget->new("."); my $calc = $mw->new_ttk__button(-text=>"Calculate", -command=>sub {calculate();}); $calc->g_grid(-column=>1,-row=>3,-columnspan=>2,-sticky=>"ew"); $calc->g_bind("", sub {$calc->configure(-background=>'red');}); Tkx::MainLoop();