diff options
author | mertz | 2002-03-13 16:32:52 +0000 |
---|---|---|
committer | mertz | 2002-03-13 16:32:52 +0000 |
commit | 7089c5829069f90418c008f10dfbae53193d59e5 (patch) | |
tree | eeb7e5ee65169f49f604599e2f56ca8edadff60d /Perl/demos/Tk/demos/zinc_lib/counter.pl | |
parent | 29dd44adea35da3a55fe953aae32ed74cc56f6d2 (diff) | |
download | tkzinc-7089c5829069f90418c008f10dfbae53193d59e5.zip tkzinc-7089c5829069f90418c008f10dfbae53193d59e5.tar.gz tkzinc-7089c5829069f90418c008f10dfbae53193d59e5.tar.bz2 tkzinc-7089c5829069f90418c008f10dfbae53193d59e5.tar.xz |
- suppression/inhibition des timers utilis�es dans counter.pl simpleradar.pl
et qui ne posent probleme que lorsque ces scripts sont appel�s depuis zinc-demos
- modificiation des chemins de chargements des modules externes utilis�s par
simpleradar.pl wheelOfFortune.pl
Diffstat (limited to 'Perl/demos/Tk/demos/zinc_lib/counter.pl')
-rw-r--r-- | Perl/demos/Tk/demos/zinc_lib/counter.pl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/counter.pl b/Perl/demos/Tk/demos/zinc_lib/counter.pl index a9bd20d..6907fab 100644 --- a/Perl/demos/Tk/demos/zinc_lib/counter.pl +++ b/Perl/demos/Tk/demos/zinc_lib/counter.pl @@ -291,7 +291,16 @@ my $nbtour_unit=2; #-------------------------------- # Timer #--------------------------------- -$zinc->repeat($repeat, [\&refresh]); +my $timer = $zinc->repeat($repeat, [\&refresh]); + +$mw->OnDestroy(\&destroyTimersub ); + +my $timerIsDead = 0; +sub destroyTimersub { + $timerIsDead = 1; + $mw->afterCancel($timer); + # the timer is not really cancelled when using zinc-demos! +} #-------------------------------- # Actions @@ -300,6 +309,7 @@ sub refresh { #-------------------------------- # Rotation de la fleche #--------------------------------- + return if $timerIsDead; # the timer is still running when using zinc-demos! $zinc->rotate("$fleche",$angle,$centre[0],$centre[1]); $nb+=1; if (($nb==$nb_tot)&&($angle==$PI/$pas)) |