Changes between Version 9 and Version 10 of PadrePluginCookbookRecipie05


Ignore:
Timestamp:
Aug 6, 2011, 2:54:35 PM (3 years ago)
Author:
bowtie
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PadrePluginCookbookRecipie05

    v9 v10  
    1515 
    1616The examples here, where relevant will build upon Cookbook, some relate to other Plug-ins as it is more pertinent to use them, 
     17 
     18 
     19 
    1720---- 
    1821== Outline 
     
    128131---- 
    129132 
    130 * Some Plugin will require a plugin_enable method, 
     133* Some Plug-ins will require a plugin_enable method, 
    131134 * Why because it's using an external resource, which is not being picked up via perl (M::I). 
    132  * You can see this only has Ubuntu locations, it needs more OS file locations adding. 
     135 * You can see this only has Ubuntu locations, at precsent it needs more OS file locations adding. 
    133136 
    134137{{{#!perl 
     
    175178---- 
    176179 
    177 * Plugin can be loaded and unloaded repeatedly 
    178  * Don't forget to include the following sub. 
     180* Plugin_disable so that we can load and unloaded our Plug-in repeatedly, using Tools -> Reload All Plugins. 
     181Don't forget to include all the relevant sections. 
     182 1. Wx::Dialogs, as shown 
     183 1. your plugin modules, as shown, see Recipe-03 need link 
     184 1. other cpan modules that are pertinent to only your plugin, such as sockets or demons, not shown. 
     185 1. boot n braces, as shown, this is a new development, run SUPER plugin_disable, an Ode to before :) 
    179186{{{#!perl 
    180187sub plugin_disable { 
    181     .... 
     188    my $self = shift; 
     189 
     190    # Close the dialog if it is hanging around 
     191    if ( $self->{dialog} ) { 
     192        $self->{dialog}->Destroy; 
     193        $self->{dialog} = undef; 
     194    } 
     195 
     196    # Unload all our child classes 
     197    $self->unload('Padre::Plugin::Cookbook::Recipe01::Main'); 
     198    $self->unload('Padre::Plugin::Cookbook::Recipe01::FBP::MainFB'); 
     199    $self->unload('Padre::Plugin::Cookbook::Recipe02::Main'); 
     200    $self->unload('Padre::Plugin::Cookbook::Recipe02::FBP::MainFB'); 
     201    $self->unload('Padre::Plugin::Cookbook::Recipe03::Main'); 
     202    $self->unload('Padre::Plugin::Cookbook::Recipe03::FBP::MainFB'); 
     203    $self->unload('Padre::Plugin::Cookbook::Recipe03::About'); 
     204    $self->unload('Padre::Plugin::Cookbook::Recipe03::FBP::AboutFB'); 
     205    $self->unload('Padre::Plugin::Cookbook::Recipe04::Main'); 
     206    $self->unload('Padre::Plugin::Cookbook::Recipe04::FBP::MainFB'); 
     207    $self->unload('Padre::Plugin::Cookbook::Recipe04::About'); 
     208    $self->unload('Padre::Plugin::Cookbook::Recipe04::FBP::AboutFB'); 
     209     
     210    $self->SUPER::plugin_disable(@_); 
     211     
     212    return 1;     
    182213} 
    183214}}} 
     
    185216---- 
    186217=== POD 
     218I have found {{{Catalyst::Controller::POD}}} to be the best way to view POD for me, as it correctly formats, highlights and colourise the syntax. it may be overkill but it's pretty. 
     219* Licence 
     220* Acknowledge others 
    187221 * Fail: Padre POD viewer displays an error 
    188222 * Poor: Fail < Poor < Min 
     
    193227=== DEBUG 
    194228This is cool 
    195 * now I can keep my say(print) statments, but turn then on when I want, with out littering the terminal :) 
     229* now I can keep my say(print) statements, but turn then on when I want, with out littering the terminal :) 
    196230 
    197231try the following 
     
    233267this is probably your end goal. 
    234268* public repository 
    235 * about dialog 
     269* about dialogue 
    236270* plugin has icon 
    237271----