#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::DialogBox; my $mw = MainWindow->new(); $mw->geometry("600x400+100+100"); my $dialog = $mw->DialogBox( -title => 'Test', -buttons => [qw/Yes No Cancel/], ); my $lifter; $mw->Button(-text=>'Get_dialog', -command => sub{ $lifter = $mw->repeat(100,sub{ $dialog->raise }); #my $answer = $dialog->Show; my $answer = $dialog->Show(-popover => $mw); $lifter->cancel; #do your $dialog return testing } )->pack; MainLoop;