From ed3155ca30f20826bc945dd629e7bf8b92b8f096 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 16 Jan 2005 10:06:29 +0000 Subject: MagicWindow: - hide is done on the window if popped - show is done on both the window and the child (to handle initial show on the window, and show after a hide on the child) --- perl-install/mygtk2.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index fe6a0c629..b3d5eace6 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -616,20 +616,23 @@ sub _gtknew_handle_children { #- * if the {child} doesn't handle the method, we try with the {real_window} #- (eg : add_accel_group set_position set_default_size #- * a few methods are handled specially -my %for_real_window = map { $_ => 1 } qw(show); +my %for_real_window = map { $_ => 1 } qw(); sub mygtk2::MagicWindow::AUTOLOAD { my ($w, @args) = @_; my ($meth) = $mygtk2::MagicWindow::AUTOLOAD =~ /mygtk2::MagicWindow::(.*)/; - my $s = $meth eq 'destroy' && $w->{pop_it} || - $for_real_window{$meth} || + my @s = $meth eq 'show' + ? ('real_window', 'child') : + $w->{pop_it} && ($meth eq 'destroy' || $meth eq 'hide') || + $for_real_window{$meth} || !$w->{child}->can($meth) - ? 'real_window' : 'child'; + ? 'real_window' + : 'child'; -#- warn "mygtk2::MagicWindow::$meth on $s (@args)\n"; +#- warn "mygtk2::MagicWindow::$meth", first($w =~ /HASH(.*)/), " on $s (@args)\n"; - $w->{$s}->$meth(@args); + $w->{$_}->$meth(@args) foreach @s; } sub _create_Window { -- cgit v1.2.1