sub AddItem { my $tp = $mw->Toplevel( -title => ' AddItem' ); # ->pack(-fill => 'both'); my $tpfrm = $tp->Frame( -background => '#22cc00', )->pack(-side => 'top', -fill => 'x'); my $tplbl = $tpfrm->Label( -text => 'Working...', -background => 'white', -foreground => 'black' )->pack(-side => 'top', -padx => 10); # my $tpbtn = $tpfrm->Button( # -text => 'Close', # -command => [$tp => 'destroy'], # )->pack(-side => 'top', -padx => 10, -pady => 5); #start a timer to simulate some working being done my $count = 0; my $timer = $mw->repeat(1000,sub{ $count++; if($count == 5){ $tp->withdraw } }); }