Changes between Version 28 and Version 29 of PadrePluginCookbookRecipie05


Ignore:
Timestamp:
Aug 19, 2011, 11:09:42 AM (3 years ago)
Author:
bowtie
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PadrePluginCookbookRecipie05

    v28 v29  
    37371. ok I must be stupid but with out the **return** the POD just confused me, it's to terse. 
    38381. {{{Wx::gettext(...)}}} this is use to wrap all test to be displayed in a Wx-object, more to follow relating to translations. 
     391. If you chose to use //menu_plugins// , you should consider the use of an ellipsis. 
    3940{{{#!perl 
    4041####### 
     
    4647}}} 
    4748 
     49---- 
     50=== //plugin_menu// 
     51You have a Choice, you can have a menu and sub menus, or just an item on the tools. 
     52==== plugin_menu_simple 
     53{{{#!perl 
     54sub menu_plugins_simple { 
     55        my $self = shift; 
     56        return $self->plugin_name => [ 
     57                'About' => sub { $self->show_about }, 
     58 
     59                # 'Another Menu Entry' => sub { $self->other_method }, 
     60                # 'A Sub-Menu...' => [ 
     61                #     'Sub-Menu Entry' => sub { $self->yet_another_method }, 
     62                # ], 
     63        ]; 
     64} 
     65}}} 
     66From My Plugin, covered in screen cast. 
     67 
     68==== menu_plugins 
     69If you chose this option, you should consider the use of an ellipsis in //plugin_name//. 
     70{{{#!perl 
     71sub menu_plugins { 
     72        my $self = shift; 
     73        my $main = $self->main; 
     74 
     75        # Create a manual menu item 
     76        my $item = Wx::MenuItem->new( undef, -1, $self->plugin_name, ); 
     77        Wx::Event::EVT_MENU( 
     78                $main, $item, 
     79                sub { 
     80                        local $@; 
     81                        eval { 
     82                                $self->load_dialog_main($_[0]); 
     83                        }; 
     84                }, 
     85        ); 
     86 
     87        return $item; 
     88} 
     89}}} 
     90see {{{Padre::Plugin::FormBuilder}}} 
    4891---- 
    4992=== padre_interfaces