The actual Dialog is shown using the Popup method. Any other options s +upplied to Show are passed to Popup, and can be used to position the + Dialog on the screen. Please read Tk::Popup for details.
Example:
#!/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;
Note, this may not work on old versions of Tk, like Tk800 on Perl5.6, but show some code and give more details if you still have a problem.
In reply to Re: how to place dialog in main window?
by zentara
in thread how to place dialog in main window?
by perl4me
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |