use Tk; use strict; my $Main = MainWindow->new(); my $Frame = $Main->Frame(); $Frame->pack(); my $Button1 = $Frame->Button(-text=>'One', -command=>\&one); $Button1->pack(); my $Button2 = $Frame->Button(-text=>'Two', -command=>\&two); $Button2->pack(); my $Button3 = $Frame->Button(-text=>'Three', -command=>\&three); $Button3->pack(); my $Button4 = $Frame->Button(-text=>'Four', -command=>\&four); $Button4->pack(); MainLoop(); sub one() { print "Hello\n"; } sub two() { $Button1->configure(-state => "disabled"); print "State Disabled: Only Button Three Can Enable Not Button Four.\n" } sub three() { $Button1->configure(-state => "normal"); print "State Normal\n"; } sub four() { $Button1->configure(-state => "normal"); print "State Normal\n"; }