Package pallavi :: Module EventActionManager :: Class EventBus
[hide private]
[frames] | no frames]

Class EventBus

source code


Maintains a list of event handlers based on named events. Any plugin or core built-in can listen for specific types of events by name. Further, any action or input can queue events to send at any time. An idle function processes the events on the wx MainLoop, so callbacks should make an effort to return ASAP (ie: spawn a new thread for lengthy tasks).

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
AddListener(self, eventName, callback)
Add a handler for a specific type of event.
source code
 
RemoveListener(self, eventName, callback)
Remove a specific handler for a specific type of events.
source code
 
QueueEvent(self, eventName, eventData=None)
Put an event on the queue for ASAP processing.
source code
 
idle(self, idleEvent)
A wx idle function.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

AddListener(self, eventName, callback)

source code 
Add a handler for a specific type of event. The name is the type of event to be handled, and the callback is a function that takes two arguments, the name and data of the event. Data may be none and its interpretation is listener specific.

RemoveListener(self, eventName, callback)

source code 
Remove a specific handler for a specific type of events. If its listening to other types of events, they won't be interfered with.

QueueEvent(self, eventName, eventData=None)

source code 
Put an event on the queue for ASAP processing. Data may be event specific handlers are expected to know what to do with it (similarly, callers of this function are expected to provide consistent data for each event type). All handlers listening for that type of event will be notified of the event.

idle(self, idleEvent)

source code 
A wx idle function. When the system is idling, it processes events on the queue.