diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-12-13 15:06:44 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-12-13 15:06:44 +0000 |
commit | c9435159e22983c638b2b5e01c8b91ea90e079b2 (patch) | |
tree | 95a2562f0339d6abbf2358e588963dad7ddade7f /perl-install | |
parent | db470f779b0c7fc562f93a53975f819194a69e87 (diff) | |
download | drakx-c9435159e22983c638b2b5e01c8b91ea90e079b2.tar drakx-c9435159e22983c638b2b5e01c8b91ea90e079b2.tar.gz drakx-c9435159e22983c638b2b5e01c8b91ea90e079b2.tar.bz2 drakx-c9435159e22983c638b2b5e01c8b91ea90e079b2.tar.xz drakx-c9435159e22983c638b2b5e01c8b91ea90e079b2.zip |
(quit_callback) split it out of _create_Window()
more readable
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/mygtk2.pm | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index c66d1943f..89bcf33f0 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -1212,6 +1212,22 @@ sub mygtk2::MagicWindow::AUTOLOAD { $w->{$s1}->$meth(@args); } +sub quit_callback { + my ($w) = @_; + + if ($::isWizard) { + $w->destroy; + die 'wizcancel'; + } else { + if (Gtk2->main_level) { + Gtk2->main_quit; + } else { + # block window deletion if not in main loop (eg: while starting the GUI) + return 1; + } + } +} + sub _create_Window { my ($opts, $special_center) = @_; @@ -1232,19 +1248,7 @@ sub _create_Window { my $w = _gtk(undef, 'Window', 'gtknew', $opts); #- when the window is closed using the window manager "X" button (or alt-f4) - $w->signal_connect(delete_event => sub { - if ($::isWizard) { - $w->destroy; - die 'wizcancel'; - } else { - if (Gtk2->main_level) { - Gtk2->main_quit; - } else { - # block window deletion if not in main loop (eg: while starting the GUI) - return 1; - } - } - }); + $w->signal_connect(delete_event => \&quit_callback); if ($::isInstall && !$::isStandalone) { require install::gtk; #- for perl_checker |