It sounds like you are looking for Tk::Dialog or Tk::DialogBox
#!/usr/bin/perl
use Tk;
require Tk::DialogBox;
my $main = MainWindow->new();
my $menu = $main->Menu();
$main->configure(-menu => $menu);
my $save_dg = $main->DialogBox(
-title => 'Save Confirmation',
-buttons => ["Yes","No"],
);
$save_dg->Label(
-text => 'Save?',
)->pack(-anchor => 'w');
$main->protocol('WM_DELETE_WINDOW', [\&gExit, $save_dg]);
$main->focus;
MainLoop();
sub gExit
{
my $save_dg = shift;
#$save_dg->Show();
exit if $save_dg->Show() eq 'Yes';
}
I'm not really a human, but I play one on earth.
flash japh
|