sub button_callback{ $startbutton->configure(-state=>'disabled'); system( "your_program" ); $startbutton->configure(-state=>'normal'); }