tkinter canvas not updating color

后端 未结 2 1959
一向
一向 2021-01-24 20:35

I draw an oval into a canvas which works perfect also it show color red and the loops runs fine too cause I can see the print. Its supposed to change the color ever 1000ms. But

2条回答
  •  半阙折子戏
    2021-01-24 21:14

    You are using itemconfig incorrectly; it takes an item, not a tag.

    Try find_withtag to get all items tagged "light", then use itemconfig on that.

    You should also pay attention to what Bryan Oakley said. Right now you're creating a new canvas and oval every time. Better place the first three lines of this method elsewhere where they aren't repeated.

提交回复
热议问题