No such thing as a small change | |
PerlMonks |
Tk Canvas Animationby dvergin (Monsignor) |
on Jan 02, 2002 at 12:59 UTC ( [id://135637]=perlquestion: print w/replies, xml ) | Need Help?? |
dvergin has asked for the wisdom of the Perl Monks concerning the following question:
I've been playing around with a version of
the Solitaire game from
The Perl Journal #18. (Actually I'm working with a modified
version of the game found
here
where a link to the card images can also be found.)
It occured to me that it would be slick if the cards would slide from one place to another instead of just suddenly appearing in the new location. But it didn't work. I have reduced the problem to the following snippet which seems to demonstrate that Tk only updates the screen at the end of a callback -- but not during it. What happens is that when I click on the 'Slide It' button, there is a delay and then the image suddenly appears on the final position. No slide animation. So... Is there a way to animate the movement of an image on a canvas? Is there some other way to achieve what I am trying to do? Here's the code:
------------------------------------------------------------
Back to
Seekers of Perl Wisdom
|
|