Canvas widget vẽ text, ảnh, graphics. Để cấu hình động Canvas item, dùng itemconfig(**options).
Ví dụ: tạo line, click button đổi màu line qua itemconfig(line, fill="green").
Ví dụ
from tkinter import *
win = Tk()
win.geometry("700x350")
def on_click():
canvas.itemconfig(line, fill="green")
canvas = Canvas(win, width=500, height=300)
canvas.pack()
line = canvas.create_line(100, 200, 200, 35, fill="yellow", width=5)
Button(win, text="Update the Color", command=on_click).pack()
win.mainloop()
Kết quả
Canvas có line vàng. Click button → line đổi xanh lá.

itemconfig áp dụng cho: line, rectangle, oval, text, image, polygon... Thuộc tính: fill, outline, width, dash, font, text, image, state...