aboutsummaryrefslogtreecommitdiff
path: root/Perl/demos/Tk
diff options
context:
space:
mode:
authoretienne2004-03-05 12:36:08 +0000
committeretienne2004-03-05 12:36:08 +0000
commit57d0219e98c3ccb4b260d58a4264a9e02678e708 (patch)
treeea3b519af50da91bf585f1348e8b7f0648be7b42 /Perl/demos/Tk
parente20b2111432070cc05ad5a931237c6f8ed83dfed (diff)
downloadtkzinc-57d0219e98c3ccb4b260d58a4264a9e02678e708.zip
tkzinc-57d0219e98c3ccb4b260d58a4264a9e02678e708.tar.gz
tkzinc-57d0219e98c3ccb4b260d58a4264a9e02678e708.tar.bz2
tkzinc-57d0219e98c3ccb4b260d58a4264a9e02678e708.tar.xz
Corrections pour continuer � fonctionner en V3.297
Diffstat (limited to 'Perl/demos/Tk')
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl12
1 files changed, 9 insertions, 3 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl b/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl
index d2fe155..cf117a5 100644
--- a/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl
@@ -274,7 +274,7 @@ sub _close {
my $group = $self->{topgroup};
# first step of animation
if ($cnt == 0) {
- my @pos = $widget->coords($group)};
+ my @pos = $widget->coords($group);
$x = ($x - $pos[0])/$self->{stepsnumber};
$y = ($y - $pos[1])/$self->{stepsnumber};
# last step
@@ -325,7 +325,7 @@ sub _fortune {
my $zf;
my $widget = $self->{widget};
my $group = $self->{topgroup};
- my @pos = $widget->coords($group)};
+ my @pos = $widget->coords($group);
# last step of animation
if ($cnt == 6) {
$self->{fortune} = undef;
@@ -356,11 +356,17 @@ sub _fortune {
# Update group clipping and translation, using 'scale' and 'translate'
# Zinc methods.
sub _clipAndTranslate {
+
my ($self, $shrinkfactor, $x, $y) = @_;
$x = 0 unless $x;
$y = 0 unless $y;
$self->{widget}->scale($self->{itemclip}, $shrinkfactor, $shrinkfactor);
- $self->{widget}->translate($self->{topgroup}, $x, $y);
+ if ($Tk::Zinc::VERSION lt "3.297") {
+ $self->{widget}->translate($self->{topgroup}, $x, $y);
+ } else {
+ my ($xc, $yc) = $self->{widget}->coords($self->{topgroup});
+ $self->{widget}->coords($self->{topgroup}, [$xc + $x, $yc + $y]);
+ }
}