Can you change the attributes of a Canvas object after creation? Can you change the attributes of a Canvas object after creation? tkinter tkinter

Can you change the attributes of a Canvas object after creation?


Yes you should be able to change settings of the canvas with config().

Likewise, use itemconfig() to change items on the canvas. This does require that you save a handle to the item or tag them.

Example based on tkinterbook:

item = canvas.create_line(xy, fill="red")canvas.coords(item, new_xy) # change coordinatescanvas.itemconfig(item, fill="blue") # change color