Canvas drawing slow

P

phil

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,237
Messages
2,571,190
Members
47,827
Latest member
wyton

Latest Threads

Top