Wp.EventDispatcher¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Wp.EventDispatcher(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The event dispatcher holds all the events and hooks and dispatches them. It orchestras the show on event stack.
- classmethod get_instance(core)¶
- Parameters:
core (
Wp.Core
) – the core- Returns:
the event dispatcher instance
- Return type:
Returns the event dispatcher instance that is associated with the given core.
This method will also create the instance and register it with the core, if it had not been created before.
- new_hooks_iterator()¶
- Returns:
a new iterator
- Return type:
Returns an iterator to iterate over all the registered hooks.
- push_event(event)¶
- Parameters:
event (
Wp.Event
) – the new event
Pushes a new event onto the event stack for dispatching only if there are any hooks are available for it.
- register_hook(hook)¶
- Parameters:
hook (
Wp.EventHook
) – the hook to register
Registers an event hook.
- unregister_hook(hook)¶
- Parameters:
hook (
Wp.EventHook
) – the hook to unregister
Unregisters an event hook.