From 5dbfd0e8a55369eaeaf0e72ba54aea05391c955d Mon Sep 17 00:00:00 2001 From: etienne Date: Thu, 20 Feb 2003 17:47:24 +0000 Subject: * Correction de bug : perte du focus quand on a une seule instance de zinc. --- Perl/Zinc/Debug.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Perl/Zinc/Debug.pm b/Perl/Zinc/Debug.pm index bfef8aa..6b92f45 100644 --- a/Perl/Zinc/Debug.pm +++ b/Perl/Zinc/Debug.pm @@ -54,6 +54,11 @@ my @instances; sub BEGIN { # test if ZincDebug is loaded using the -M perl option $preload = 1 if (caller(2))[2] == 0; + return unless $preload; + # parse ZincDebug options + my @options = @ARGV; + use Getopt::Long; + } # Hack to capture the instance of zinc. ZincDebug functions are invoked here. @@ -1496,7 +1501,7 @@ sub showinstancehelp { my $zinc = shift; my $title = shift; my $singleflag = shift; - $zinc->Tk::focus; + &takefocus($zinc); $help_tl{$zinc}->destroy if $help_tl{$zinc} and Tk::Exists($help_tl{$zinc}); if ($singleflag) { $help_tl{$zinc} = $zinc->Toplevel; @@ -1775,6 +1780,7 @@ sub takefocus { sub newinstance { my $zinc = shift; return if $instances{$zinc}; + &takefocus($zinc); $instances{$zinc} = 1; push(@instances, $zinc); -- cgit v1.1