Help for this page

Select Code to Download


  1. or download this
        # Start with a blank image - somehow this causes memory cleanup
        $TK{'image-'.$NVP{'Id'}}=$TK{'canvas-'.$NVP{'Id'}}->Photo(-file =>
    + "" );
    ...
        $TK{'image-'.$NVP{'Id'}}=$TK{'canvas-'.$NVP{'Id'}}->Photo($NVP{'Id
    +'},
                                                                  -file   
    +=> $NVP{'File'},
                                                                  -format 
    +=> $image{'extension'});
    
  2. or download this
        # Create a "catch" for closing the window
        $TK{'pw-'.$NVP{'Id'}}->protocol('WM_DELETE_WINDOW' => [\&CleanUpOn
    +Exit, $NVP{'Id'}]);
    
  3. or download this
      sub CleanUpOnExit
      {
    ...
        # Exit the Tk window
        Tk::exit;
      }