my $run_all_btn=$mw->Button( -text => 'run all', -width => 20, -height => 2, -activebackground => 'red', -background => 'green', -command => sub { $run_job1->invoke(); $run_job2->invoke(); $run_job3->invoke(); #I want the button freeze until run completion of all buttons job1, 2 and 3. })->pack(); $run_all_btn->flash(); #seem not working