Tk::callbacks 804.027
Sponsored Links
Tk::callbacks 804.027 Ranking & Summary
File size:
5.7 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
795
Date added:
2007-08-21
Publisher:
Tk team
Tk::callbacks 804.027 description
Tk::callbacks allows specifying code for Tk to call.
SYNOPSIS
One can specify a callback in one of the following ways:
Without arguments:
... => ⊂name, ...
... => sub { ... }, ...
... => methodname, ...
or with arguments:
... => [ ⊂name ?, args ...? ], ...
... => [ sub { ... } ?, args...? ], ...
... => [ methodname ?, args...?], ...
Perl/Tk has a callback, where Tcl/Tk has a command string (i.e. a fragment of Tcl to be executed). A perl/Tk callback can take one of the following basic forms:
Reference to a subroutine ⊂name
Anonymous subroutine (closure) sub { ... }
A method name methodname
Any of these can be provided with arguments by enclosing them and the arguments in []. Here are some examples:
$mw->bind($class, "
" => Delete);
This will call $widget->Delete, the $widget being provided (by bind) as the one where the Delete key was pressed.
While having bind provide a widget object for you is ideal in many cases it can be irritating in others. Using the list form this behaviour can be modified:
$a->bind("
",[$b => Delete]);
because the first element $b is an object bind will call $b->Delete.
Note that method/object ordering only matters for bind callbacks, the auto-quoting in perl5.001 makes the first of these a little more readable:
$w->configure(-yscrollcommand => [ set => $ysb]);
$w->configure(-yscrollcommand => [ $ysb => set ]);
but both will call $ysb->set(args provided by Tk)
Another use of arguments allows you to write generalized methods which are easier to re-use:
$a->bind("
",[Next,Page]);
$a->bind("
",[Next,Line]);
This will call $a->Next(Page) or $a->Next(Line) respectively.
Note that the contents of the [] are evaluated by perl when the callback is created. It is often desirable for the arguments provided to the callback to depend on the details of the event which caused it to be executed. To allow for this callbacks can be nested using the Ev(...) "constructor". Ev(...) inserts callback objects into the argument list. When perl/Tk glue code is preparing the argument list for the callback it is about to call it spots these special objects and recursively applies the callback process to them.
EXAMPLES
$entry->bind(
=> [$w , validate, Ev([get])]);
$toplevel->bind(all,
, [&unobscure, Ev(s)]);
$mw->bind($class,
, [SetCursor, Ev(UpDownLine,1)]);
SYNOPSIS
One can specify a callback in one of the following ways:
Without arguments:
... => ⊂name, ...
... => sub { ... }, ...
... => methodname, ...
or with arguments:
... => [ ⊂name ?, args ...? ], ...
... => [ sub { ... } ?, args...? ], ...
... => [ methodname ?, args...?], ...
Perl/Tk has a callback, where Tcl/Tk has a command string (i.e. a fragment of Tcl to be executed). A perl/Tk callback can take one of the following basic forms:
Reference to a subroutine ⊂name
Anonymous subroutine (closure) sub { ... }
A method name methodname
Any of these can be provided with arguments by enclosing them and the arguments in []. Here are some examples:
$mw->bind($class, "
This will call $widget->Delete, the $widget being provided (by bind) as the one where the Delete key was pressed.
While having bind provide a widget object for you is ideal in many cases it can be irritating in others. Using the list form this behaviour can be modified:
$a->bind("
because the first element $b is an object bind will call $b->Delete.
Note that method/object ordering only matters for bind callbacks, the auto-quoting in perl5.001 makes the first of these a little more readable:
$w->configure(-yscrollcommand => [ set => $ysb]);
$w->configure(-yscrollcommand => [ $ysb => set ]);
but both will call $ysb->set(args provided by Tk)
Another use of arguments allows you to write generalized methods which are easier to re-use:
$a->bind("
$a->bind("
This will call $a->Next(Page) or $a->Next(Line) respectively.
Note that the contents of the [] are evaluated by perl when the callback is created. It is often desirable for the arguments provided to the callback to depend on the details of the event which caused it to be executed. To allow for this callbacks can be nested using the Ev(...) "constructor". Ev(...) inserts callback objects into the argument list. When perl/Tk glue code is preparing the argument list for the callback it is about to call it spots these special objects and recursively applies the callback process to them.
EXAMPLES
$entry->bind(
$toplevel->bind(all,
$mw->bind($class,
Tk::callbacks 804.027 Screenshot
Tk::callbacks 804.027 Keywords
to call
can be
bind
callback
delete
Ev
tk
A-
Tk::callbacks
Tkcallbacks
Tk::callbacks 804.027
Libraries
Programming
Bookmark Tk::callbacks 804.027
Tk::callbacks 804.027 Copyright
WareSeeker periodically updates pricing and software information of Tk::callbacks 804.027 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Tk::callbacks 804.027 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
Tk::Canvas Perl module can create and manipulate Canvas widgets. Free Download
Callback is an object interface for function callbacks. Free Download
Tk::Balloon is a pop up help balloons. Free Download
Tk::bindtags can determine which bindings apply to a window, and order of evaluation. Free Download
Tk::bind can arrange for X events to invoke callbacks. Free Download
Tk::Adjuster module will allow size of packed widgets to be adjusted by user. Free Download
Tk::after can execute a command after a time delay. Free Download
Tk::Tiler is a scrollable frame with sub-widgets arranged into rows. Free Download
Latest Software
Popular Software
Favourite Software