enable.tools.tool_history_mixin module

Defines the ToolHistoryMixin class.

class enable.tools.tool_history_mixin.ToolHistoryMixin[source]

Bases: traits.has_traits.HasTraits

A mix-in class for tools to maintain a tool state history and to move backwards and forwards through that history stack.

This mix-in listens for keypressed events; to handle keypresses in a subclass, call self._history_handle_key(event) to have this mix-in properly process the event.


Handles a key being pressed, and takes appropriate action if it is one of the history keys defined for this class.