Tkinter - One Canvas to Rule Them All?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave Harris

    Tkinter - One Canvas to Rule Them All?

    I derived two Frame classes and created a Canvas in each. I was extremely
    surprised when frame1.canvas.d elete('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

  • Peter Otten

    #2
    Re: Tkinter - One Canvas to Rule Them All?

    Dave Harris wrote:
    [color=blue]
    > I derived two Frame classes and created a Canvas in each. I was extremely
    > surprised when frame1.canvas.d elete('all') erased the image in
    > frame2.canvas![/color]

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

    I can't confirm that.

    Peter

    Comment

    Working...