Padre::Plugin::Shell::BaseA base class for Padre plugins | |
Download |
Padre::Plugin::Shell::Base Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Gregory Siems
- Publisher web site:
- http://search.cpan.org/~gsiems/
Padre::Plugin::Shell::Base Tags
Padre::Plugin::Shell::Base Description
A base class for Padre plugins Padre::Plugin::Shell::Base is a base class for plugins that use the system shell to extend Padre.ExampleSubclass Padre::Plugin::Shell::Base to create a plugin. package Padre::Plugin::Shell::Foo; use base 'Padre::Plugin::Shell::Base'; use 5.008; use strict; use warnings; use Padre::Wx (); sub plugin_menu { my ($self) = @_; my @menu = (); push @menu, "Do Foo" => sub {$self->do_foo()}; push @menu, '---' => undef; push @menu, Wx::gettext("&Configure Foo") => sub { $self->edit_config_file() },; return @menu; } sub example_config { my ($self) = @_; my $config = "---\n"; # additional config return $config; } sub do_foo { my ( $self ) = @_; my %config = $self->get_config(); # additional foo } 1;Subclass Padre::Plugin to wrap the plugin. package Padre::Plugin::Foo; use base 'Padre::Plugin'; use 5.008; use strict; use warnings; use Padre::Plugin (); use Padre::Plugin::Shell::Foo; our $VERSION = '0.01'; my $foo_plugin; sub plugin_name { 'Foo'; } sub padre_interfaces { 'Padre::Plugin' => 0.43; } sub menu_plugins_simple { my ($self) = @_; $foo_plugin = Padre::Plugin::Shell::Foo->new(); 'Foo' => ; } 1; Requirements: · Perl
Padre::Plugin::Shell::Base Related Software