| Home | Trees | Index | Help |
|---|
| Package ocempgui :: Package events :: Module EventManager :: Class EventManager |
|
object --+
|
EventManager
EventManager () -> EventManager
An event distribution system.
The EventManager enables objects to receive events. Each object can register several signal types, on which occurance the EventManager will call the object's 'notify' method with that event.
Events also can be distributed by invoking the 'emit()' method of the EventManager.
Attributes: queues - A dict with signal-list associations of registered objects. event_grabber - The event grabbing object, which will receive all events.| Method Summary | |
|---|---|
__init__(self)
| |
E.__len__ () -> len (E) | |
E.add_high_priority_object (...) -> None | |
E.add_object (...) -> None | |
E.clear () -> None | |
E.emit (...) -> None | |
E.emit_event (...) -> None | |
E.grab_events (...) -> None | |
E.remove_object (...) -> None | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Property Summary | |
|---|---|
event_grabber: Sets the event grabber object. | |
| Method Details |
|---|
__len__(self)
|
add_high_priority_object(self, obj, *signals)E.add_high_priority_object (...) -> None Adds a high priority object to the EventManager. High priority objects do not differ from normal objects. Instead they are added in the first place to the signal queues instead of being appended to them like add_object() does. This results in notifying those objects in the first place. Raises an AttributeError, if the passed 'obj' argument does not have a callable notify attribute. |
add_object(self, obj, *signals)E.add_object (...) -> None Adds an object to the EventManger. Adds an object as listener for one or more events to the EventManager. Each event type in the *signals argument will cause the object to be added to a respective queue, on which events with the same type will be emitted. Raises an AttributeError, if the passed 'obj' argument does not have a callable notify attribute. |
clear(self)E.clear () -> None Removes all objects and signals from all event queues. |
emit(self, signal, data)E.emit (...) -> None Emits an event, which will be sent to the objects. Emits an event on a specific queue of the EventManager, which will be sent to the objects in that queue. If one of the receiving objects sets the 'handled' attribute of the event to True, the emission will stop immediately so that following objects will not receive the event. |
emit_event(self, event)E.emit_event (...) -> None Emits an event, which will be sent to the objects. Emits an event on a specific queue of the EventManager, which will be sent to the objects in that queue. If one of the receiving objects sets the 'handled' attribute of the event to True, the emission will stop immediately so that following objects will not receive the event. |
grab_events(self, obj)E.grab_events (...) -> None Sets an event grabber object for the EventManager. Causes the EventManager to send _all_ its events only to this object instead of the objects in its queues. It is up to the event grabbing object to filter the events, it received. |
remove_object(self, obj, *signals)E.remove_object (...) -> None Removes an object from the EventManager. Removes the object from the queues passed as the 'signals' arguments. If 'signals' is None, the object will be removed from all queues of the EventManager. |
| Property Details |
|---|
event_grabberSets the event grabber object.
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Jan 10 10:18:44 2008 | http://epydoc.sf.net |