def destroy
      # typically the ensure block should have this

      #$log.debug "win destroy start"

      $global_windows.delete self
      Ncurses::Panel.del_panel(@panel.pointer) if @panel
      delwin() if @window 
      Ncurses::Panel.update_panels # added so below window does not need to do this 2011-10-1 

      # destroy any pads that were created by widgets using get_pad
      @pads.each { |pad|  
        FFI::NCurses.delwin(pad) if pad 
        pad = nil
      } if @pads
      # added here to hopefully take care of this issue once and for all. 
      # Whenever any window is destroyed, the root window is repainted.
      #
      # 2014-08-18 - 20:35 trying out without refresh  all since lower dialog gets erased
      Window.refresh_all
      #$log.debug "win destroy end"
    end
def destroy
      # typically the ensure block should have this

      #$log.debug "win destroy start"

      $global_windows.delete self
      Ncurses::Panel.del_panel(@panel.pointer) if @panel
      delwin() if @window 
      Ncurses::Panel.update_panels # added so below window does not need to do this 2011-10-1 

      # destroy any pads that were created by widgets using get_pad
      @pads.each { |pad|  
        FFI::NCurses.delwin(pad) if pad 
        pad = nil
      } if @pads
      # added here to hopefully take care of this issue once and for all. 
      # Whenever any window is destroyed, the root window is repainted.
      #
      # 2014-08-18 - 20:35 trying out without refresh  all since lower dialog gets erased
      Window.refresh_all
      #$log.debug "win destroy end"
    end
destroy window, panel and any pads that were requested