Answers for "hovering over canvas item tkinter event"

0

hovering over canvas item tkinter event

You can pass the argument activefill when creating your rectangle.

From effboot.org:

Fill color to use when the mouse pointer is moved over the item, if different from fill.

To do so, replace:

rectangle = self.canvas.create_rectangle(x, y, x + 50, y + 50, fill='red')
By:

rectangle = self.canvas.create_rectangle(x, y, x + 50, y + 50, fill='red', activefill='cyan')
Posted by: Guest on June-02-2020

Python Answers by Framework

Browse Popular Code Answers by Language