enable.tools.hover_tool module

Tool to detect when the user hovers over a specific part of an underlying components.

enable.tools.hover_tool.GetGlobalMousePosition()[source]
class enable.tools.hover_tool.HoverTool(component=None, **traits)[source]

Bases: enable.base_tool.BaseTool

Tool to detect when the user hovers over a certain area on a component. The type of area to detect can be configured by the ‘area_type’ and ‘bounds’ traits.

Users of the class should either set the ‘callback’ attribute, or subclass and override on_hover().

normal_mouse_move(event)[source]
on_hover(*args, **kwargs)[source]

This gets called when all the conditions of the hover action have been met, and the tool determines that the mouse is, in fact, hovering over a target region on the component.

By default, this method call self.callback (if one is configured).

on_timer(*args, **kwargs)[source]
restart_hover_timer(event)[source]