How to clear Tkinter Canvas?

后端 未结 3 1928
刺人心
刺人心 2020-12-13 17:26

When I draw a shape using:

canvas.create_rectangle(10, 10, 50, 50, color=\"green\")

Does Tkinter keep track of the fact that it was created

3条回答
  •  北海茫月
    2020-12-13 17:56

    Yes, I believe you are creating thousands of objects. If you're looking for an easy way to delete a bunch of them at once, use canvas tags described here. This lets you perform the same operation (such as deletion) on a large number of objects.

提交回复
热议问题