Changeset 8594


Ignore:
Timestamp:
10/03/09 13:23:42 (2 years ago)
Author:
szabgab
Message:

[Parrot] add menu option to open example files

Location:
trunk/Padre-Plugin-Parrot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre-Plugin-Parrot/Changes

    r8489 r8594  
    11Revision history for Padre-Plugin-Parrot 
     2 
     3    - Add menu option to open one of the installed example files. 
    24 
    350.26 2009.10.02 
  • trunk/Padre-Plugin-Parrot/Makefile.PL

    r8508 r8594  
    3030 
    3131#requires => 'Parrot::Embed' => 0; 
     32requires => 'File::ShareDir' => 0; 
    3233test_requires 'Test::More' => '0.47'; 
    3334no_index 'directory'       => qw{ t xt eg share inc privinc}; 
  • trunk/Padre-Plugin-Parrot/lib/Padre/Plugin/Parrot.pm

    r8502 r8594  
    220220    my $self = shift; 
    221221    return $self->plugin_name => [ 
    222         'About'     => sub { $self->about }, 
    223         'PIR 2 PBC' => sub { $self->pir2pbc }, 
     222        'About'        => sub { $self->about }, 
     223        'Open Example' => sub { $self->open_example }, 
     224        'PIR 2 PBC'    => sub { $self->pir2pbc }, 
    224225 
    225226        #'Help'                                        => \&show_help, 
     
    400401} 
    401402 
     403sub open_example { 
     404    require File::ShareDir; 
     405    my $dir = File::Spec->catdir( 
     406        File::ShareDir::dist_dir('Padre-Plugin-Parrot'), 
     407        'examples'); 
     408 
     409    my $main = Padre->ide->wx->main; 
     410    return $main->open_file_dialog( $dir ); 
     411} 
     412 
    402413sub about { 
    403     my ($main) = @_; 
    404  
    405414    my $about = Wx::AboutDialogInfo->new; 
    406415    $about->SetName(__PACKAGE__); 
Note: See TracChangeset for help on using the changeset viewer.