summaryrefslogtreecommitdiff
path: root/Master/tlpkg/installer/install-menu-perltk.pl
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-07-09 15:30:44 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-07-09 15:30:44 +0000
commitc7e0f785c81676e70e4541817798999a420e0202 (patch)
tree46fb6300a966b8b5384aa77cc76cb95dec02f916 /Master/tlpkg/installer/install-menu-perltk.pl
parent90d6f05755719766ccbcbe9eb8bea018f20ac348 (diff)
Poperly destroy the main window when user closes it using her window manager.
(Avoids errors in the hooks due to $mw being neither valid nor undefined.) git-svn-id: svn://tug.org/texlive/trunk@19304 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/installer/install-menu-perltk.pl')
-rw-r--r--Master/tlpkg/installer/install-menu-perltk.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl
index 5ff59b27a47..7420160ad98 100644
--- a/Master/tlpkg/installer/install-menu-perltk.pl
+++ b/Master/tlpkg/installer/install-menu-perltk.pl
@@ -90,6 +90,11 @@ $::run_menu = \&run_menu_perltk;
# ##################################################################
+sub menu_abort {
+ $return = $MENU_ABORT;
+ $mainwindow->destroy;
+}
+
sub setup_hooks_perltk {
@::info_hook = ();
push @::info_hook,
@@ -134,6 +139,7 @@ sub update_progressbar {
sub run_menu_perltk {
calc_depends();
$mainwindow = Tk::MainWindow->new;
+ $mainwindow->protocol('WM_DELETE_WINDOW' => \&menu_abort);
setup_hooks_perltk();
if (!win32()) {
@@ -316,7 +322,7 @@ sub run_menu_perltk {
)->pack(-side => 'left', -padx => "2m", -pady => "2m")->focus();
my $quitbutton = $f3->Button(
-text => __("Quit"),
- -command => sub { $return = $MENU_ABORT; $mainwindow->destroy }
+ -command => \&menu_abort,
)->pack(-side => 'right', -padx => "2m", -pady => "2m");
$mw->bind('<Escape>', [ $quitbutton, 'Invoke' ]);
#my $wizardbutton = $f3->Button(