Changes between Version 9 and Version 10 of PadrePluginCookbookRecipie05
- Timestamp:
- 08/06/11 14:54:35 (22 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PadrePluginCookbookRecipie05
v9 v10 15 15 16 16 The 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 17 20 ---- 18 21 == Outline … … 128 131 ---- 129 132 130 * Some Plug inwill require a plugin_enable method,133 * Some Plug-ins will require a plugin_enable method, 131 134 * 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. 133 136 134 137 {{{#!perl … … 175 178 ---- 176 179 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. 181 Don'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 :) 179 186 {{{#!perl 180 187 sub 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; 182 213 } 183 214 }}} … … 185 216 ---- 186 217 === POD 218 I 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 187 221 * Fail: Padre POD viewer displays an error 188 222 * Poor: Fail < Poor < Min … … 193 227 === DEBUG 194 228 This is cool 195 * now I can keep my say(print) stat ments, 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 :) 196 230 197 231 try the following … … 233 267 this is probably your end goal. 234 268 * public repository 235 * about dialog 269 * about dialogue 236 270 * plugin has icon 237 271 ----
