NAME

Curses::Toolkit::Event - base class for events

VERSION

version 0.208

DESCRIPTION

Base class for events

CONSTRUCTOR

None, this is an abstract class, please use one of the children

Event Propagation

By default, an event can "propagate" : if 2 event listeners ( see EventListener) can handle an event, the event will be given to the 2 listeners, in the order the listeners were created and associated to the widget.

However, if you disable propagation, the event will be given to the first listener that can handle it, and that's it. Even if others listeners could handle it in the row, they won't be executed.

Event Restriction to the widget

By default, an event is not restricted to a widget : if there is no listener matching the event, attached to the widget, the event is given to the parent widget recursively.

However, if you enable event restriction, the event will not be passed to the parent widget. Only the listener of the widget will be tested.

METHODS

get_type

Returns the type of the event

enable_propagation

Enable propagation of the event to other matching listeners

disable_propagation

Disable propagation of the event to other matching listeners

can_propagate

Returns wether the event can propagate

enable_restriction

Enable restriction of the event to the original widget : the event won't be passed to parent widgets

disable_restriction

Disable restriction of the event to the original widget : the event will be passed to parent widgets

restricted_to_widget

Returns wether the event is restricted to the widget

custom_data

Returns a HashRef, which is attached to the event. The pointed Hash can be modified to store custom temporary data in the event. Mostly useful when creating an event listener.

AUTHOR

Damien "dams" Krotkine

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Damien "dams" Krotkine.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.