enable.tools.hover_tool module

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

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().

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]