Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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')
 
PREVIOUS NEXT
Tagged: #hovering #canvas #item #tkinter #event
ADD COMMENT
Topic
Name
1+3 =