Changing the colour on click of a tkinter rectangle on click in python
Name it and then refer to it through itemconfig
, like this:
myrectangle = canvas.create_rectangle(100, 100, 400, 400, fill='black')canvas.itemconfig(myrectangle, fill='red')
Name it and then refer to it through itemconfig
, like this:
myrectangle = canvas.create_rectangle(100, 100, 400, 400, fill='black')canvas.itemconfig(myrectangle, fill='red')