#this is psuedo-codeish use Tk; my $mw = new Tk::MainWindow; my $p_bar = $mw->ProgressBar; # No longer needed: # my $button = $mw->Button(-command=>\&main_logic, -text=>'start'); # $button->pack(); $p_bar->pack(); #this is the solution, thanks to Ven'Tatsu: $mw->after(0,\&main_logic); MainLoop; sub main_logic { # $button->configure(-state=>"disabled"); for (...) { # do some stuff... $p_bar->value($pct_complete); $mw->update(); } $mw->destroy; }