Canvas drawing slow

phil phillip.watts at anvilcom.com
Mon May 2 13:53:12 EDT 2005


I'm mapping quadratic equations on a Canvas.
But that's irrelevant, the point is I am drawing
a lot of points in a loop without returning to
mainloop until the end.  I want my students to see the
drawing progress, so I call update_idletasks() after
each tiny rectangle. ( I use to call update() and it
seems to make no difference)

This is so fast at first I am tempted to put a sleep(.01) in the
loop.  But after a few thousand points it starts to slow down
dramatically.  WHy?  I thought udate_idletasks would only redraw
the 'damaged' portion.
Maybe my approach is wrong.

I was hoping to use Canvas to do some simple instructional
animation, but not if I can't solve this mystery.

Any help appreciated.


BTW: I posted a couple days ago about rotating objects making
the item stack grow.  My bad, debugging bug, fixed it.




More information about the Python-list mailing list