Tkinter - One Canvas to Rule Them All?

D

Dave Harris

I derived two Frame classes and created a Canvas in each. I was extremely
surprised when frame1.canvas.delete('all') erased the image in
frame2.canvas!

I resolved my trouble by assigning tags and doing the deletion by tag. No
big deal.

I deduce from this behavior that there is a single database behind the
scenes for the Canvas implementation.

Just an observation. Maybe it will save somebody some head-scratching...

Dave Harris
 
P

Peter Otten

Dave said:
I derived two Frame classes and created a Canvas in each. I was extremely
surprised when frame1.canvas.delete('all') erased the image in
frame2.canvas!

Maybe you are accidentally deleting the last reference to the image (the
canvas itself doesn't keep one). Care to show some code?
I deduce from this behavior that there is a single database behind the
scenes for the Canvas implementation.

I can't confirm that.

Peter
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top