Animation with Tk

s713221 at student.gu.edu.au s713221 at student.gu.edu.au
Sat Apr 21 21:08:18 EDT 2001


Nick Perkins wrote:
> 
> How can I run a timing loop in a Tk app?
> I would like to use the Tk.Canvas widget to try some simple animation.
> It has some cool features.
> I need to have an animation loop, but also have working buttons, etc,
> which means running the tk mainloop.
> 
> I have tried to use the sched module, sheduling a function that
> updates the canvas and then reschedules itself.
> However, the run() method does not return immediately, which would be
> nice, it just goes to sleep.
> Consequently, I can not seem to get Tk.mainloop() to run
> at the same time as a scheduler.
> Since I am using Windows, I don't think I can fork().
> 
> How can I run a Tk mainloop() and also an event sheduler, or
> some other type of timing loop?

Also, have a look at pyChing (You can get a link at the Vaults). It's
got some cool coin animations. (My first response - I didn't know you
could do that with python???)

Joal Heagney/AncientHart



More information about the Python-list mailing list