📜  悬停在画布项目 tkinter 事件上 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:38.830000             🧑  作者: Mango

代码示例1
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')