NAME
Gapp::Actions - Create Actions for Gapp Applications
SYNOPSIS
package My::Actions;
use Gapp::Actions -declare =>[qw( PrintStuff )];
action PrintStuff => (
name => 'PrintStuff',
label => 'Print',
tooltip => 'Print',
icon => 'gtk-print',
code => sub {
my ( $action, $args ) = @_;
print $args[0], "\n";
}
);
... later ...
package main;
use My::Actions qw( PrintStuff );
# call directly
do_PrintStuff( 'Stuff!' );
# assign to button
Gapp::Button->new( action => [PrintStuff, 'stuff'] );
# use as callback
Gapp::Button->new->signal_connect( clicked => PrintStuff, 'stuff' );
DESCRIPTION
Actions are chunks of code that know how to display themselves on buttons, menus and other objects. They can be called directly, or used as callbacks.
SEE ALSO
ACKNOWLEDGEMENTS
Many thanks to the #moose
cabal on irc.perl.org
, and all those who contributed to the MooseX::Types module, making Gapp::Actions possible.
AUTHORS
Robert "phaylon" Sedlacek <rs@474.at>
Jeffrey Ray Hallock <jeffrey.hallock at gmail dot com>
CONTRIBUTORS
jnapiorkowski: John Napiorkowski <jjnapiork@cpan.org>
caelum: Rafael Kitover <rkitover@cpan.org>
rafl: Florian Ragwitz <rafl@debian.org>
hdp: Hans Dieter Pearcey <hdp@cpan.org>
autarch: Dave Rolsky <autarch@urth.org>
COPYRIGHT & LICENSE
Copyright (c) 2007-2009 Robert Sedlacek <rs@474.at>
Copyright (c) 2011 Jeffrey Ray Hallock.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.