use strict; use warnings; use Tkx; use threads; # ... set up your controls $bar->configure( -orient => "horizontal", -mode => "indeterminate", ); $bar->start(); my $thread = threads->create(sub { system("my.bat"); }); $thread->set_thread_exit_only(1); while ($thread->is_running()) { Tkx::update(); } $progress_bar->stop();