my $top2 = MainWindow->new(); my $waitbox = $top2->WaitBox(-title=>"Connecting to agent $port", -txt1=>"Connecting to Agent $port.\nConnection will be established when this box closes.\n", -cancelroutine=>sub { print "\nCancelling...\n"; $top2->unShow; die} ); fork and $waitbox->Show; #do some non-graphical background stuff in here $waitbox->unShow; MainLoop();