Changes between Version 41 and Version 42 of PadrePluginCookbookRecipie05


Ignore:
Timestamp:
09/01/11 10:53:57 (3 years ago)
Author:
bowtie
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PadrePluginCookbookRecipie05

    v41 v42  
    263263 1. other cpan modules that are pertinent to only your plugin, such as sockets or demons, not shown. 
    264264 1. boot n braces, as shown, this is a new development, run SUPER plugin_disable, an Ode to before :) 
     265 
    265266{{{#!perl 
    266267sub plugin_disable { 
     
    268269 
    269270    # Close the dialog if it is hanging around 
    270     if ( $self->{dialog} ) { 
    271         $self->{dialog}->Destroy; 
    272         $self->{dialog} = undef; 
    273     } 
     271    $self->clean_dialog; 
    274272 
    275273    # Unload all our child classes 
     
    297295}}} 
    298296 
     297Why a composed Method you ask, in Cookbook it just makes sense, if you have more than one dialog and we have more than 3. 
     298{{{#!perl 
     299######## 
     300# Composed Method clean_dialog 
     301######## 
     302sub clean_dialog { 
     303        my $self = shift; 
     304 
     305        # Close the main dialog if it is hanging around 
     306        if ( $self->{dialog} ) { 
     307                $self->{dialog}->Hide; 
     308                $self->{dialog}->Destroy; 
     309                delete $self->{dialog}; 
     310        } 
     311 
     312        return 1; 
     313} 
     314}}} 
     315 
    299316---- 
    300317