Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

prima::eventhook(3) [debian man page]

Prima::EventHook(3)					User Contributed Perl Documentation				       Prima::EventHook(3)

NAME
Prima::EventHook - event filtering SYNOPSIS
use Prima::EventHook; sub hook { my ( $my_param, $object, $event, @params) = @_; ... print "Object $object received event $event "; ... return 1; } Prima::EventHook::install( &hook, param => $my_param, object => $my_window, event => [qw(Size Move Destroy)], children => 1 ); Prima::EventHook::deinstall(&hook); DESCRIPTION
Prima dispatches events by calling notifications registered on one or more objects interested in the events. Also, one event hook can be installed that would receive all events occurred on all objects. "Prima::EventHook" provides multiplex access to the core event hook and introduces set of dispatching rules so the user hook subs receive only a defined subset of events. The filtering criteria are event names and object hierarchy. API
install SUB, %RULES Installs SUB into hook list using hash of RULES. The SUB is called with variable list of parameters, formed so first passed parameters from 'param' key ( see below ), then event source object, then event name, and finally parameters to the event. SUB must return an integer, either 0 or 1, to block or pass the event, respectively. If 1 is returned, other hook subs are called; if 0 is returned, the event is efficiently blocked and no hooks are further called. Rules can contain the following keys: event Event is either a string, an array of strings, or "undef" value. In the latter case it is equal to '*' string, which selects all events to be passed in the SUB. A string is either name of an event, or one of pre-defined event groups, declared in %groups package hash. The group names are: ability focus geometry keyboard menu mouse objects visibility These contain respective events. See source for detailed description. In case 'event' key is an array of strings, each of the strings is also name of either an event or a group. In this case, if '*' string or event duplicate names are present in the list, SUB is called several times which is obviously inefficient. object A Prima object, or an array of Prima objects, or undef; the latter case matches all objects. If an object is defined, the SUB is called if event source is same as the object. children If 1, SUB is called using same rules as described in 'object', but also if the event source is a child of the object. Thus, selecting "undef" as a filter object and setting 'children' to 0 is almost the same as selecting $::application, which is the root of Prima object hierarchy, as filter object with 'children' set to 1. Setting together object to "undef" and children to 1 is inefficient. param A scalar or array of scalars passed as first parameters to SUB whenever it is called. deinstall SUB Removes the hook sub for the hook list. NOTES
"Prima::EventHook" by default automatically starts and stops Prima event hook mechanism when appropriate. If it is not desired, for example for your own event hook management, set $auto_hook to 0. AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>. SEE ALSO
Prima, Prima::Object perl v5.14.2 2009-02-24 Prima::EventHook(3)

Check Out this Related Man Page

Prima::StdDlg(3)					User Contributed Perl Documentation					  Prima::StdDlg(3)

NAME
Prima::StdDlg - wrapper module to the toolkit standard dialogs DESCRIPTION
Provides a unified access to the toolkit dialogs, so there is no need to "use" the corresponding module explicitly. SYNOPSIS
use Prima::StdDlg; Prima::FileDialog-> create-> execute; Prima::FontDialog-> create-> execute; # open standard file open dialog my $file = Prima::open_file; print "You've selected: $file " if defined $file; API
The module accesses the following dialog classes: Prima::open_file Invokes standard file open dialog and return the selected file(s). Uses system-specific standard file open dialog, if available. Prima::save_file Invokes standard file save dialog and return the selected file(s). Uses system-specific standard file save dialog, if available. Prima::OpenDialog File open dialog. See "Prima::OpenDialog" in Prima::FileDialog Prima::SaveDialog File save dialog. See "Prima::SaveDialog" in Prima::FileDialog Prima::ChDirDialog Directory change dialog. See "Prima::ChDirDialog" in Prima::FileDialog Prima::FontDialog Font selection dialog. See Prima::FontDialog. Prima::FindDialog Generic 'find text' dialog. See Prima::EditDialog. Prima::ReplaceDialog Generic 'find and replace text' dialog. See Prima::EditDialog. Prima::PrintSetupDialog Printer selection and setup dialog. See Prima::PrintDialog. Prima::ColorDialog Color selection dialog. See "Prima::ColorDialog" in Prima::ColorDialog. Prima::ImageOpenDialog Image file load dialog. See "Prima::ImageOpenDialog" in Prima::ImageDialog. Prima::ImageSaveDialog Image file save dialog. See "Prima::ImageSaveDialog" in Prima::ImageDialog. AUTHORS
Anton Berezin <tobez@plab.ku.dk>, Dmitry Karasik, <dmitry@karasik.eu.org>. SEE ALSO
Prima, Prima::Classes perl v5.14.2 2009-02-24 Prima::StdDlg(3)
Man Page