Skip to content Skip to sidebar Skip to footer

Tkinter Canvas Reset Id's

I am coding a Tkinter GUI for a senior research project at school. I need to, at some point in the code, reset the counter used to create id values for new additions. Does anyone

Solution 1:

It is not possible to reset the id numbers generated by a canvas.

Your solution of deleting and recreating the canvas is a reasonable alternative, though it may not be necessary. There are probably better ways to do whatever it is you think is solved by resetting canvas ids. For example, you could generate your own ids, and associate each id with each canvas item as a tag. You can then reset the ids any time you want.

Post a Comment for "Tkinter Canvas Reset Id's"