pyface.action.listening_action module

class pyface.action.listening_action.ListeningAction[source]

Bases: Action

An Action that listens and makes a callback to an object.

method = Str()

The (extended) name of the method to call. By default, the on_perform function will be called with the event.

enabled_name = Str()

The (extended) name of the attribute that determines whether the action is enabled. By default, the action is always enabled when an object is set.

visible_name = Str()

The (extended) name of the attribute that determines whether the action is visible. By default, the action is always visible.

object = Any()

The object to which the names above apply.

destroy()[source]

Called when the action is no longer required.

Removes all the task listeners.

perform(event=None)[source]

Call the appropriate function.

This looks for a method to call based on the extended method name stored in the method trait. If the method is empty, then this follows the usual Action method resolution.