parameters: (self, pane_info)
docstring: Destroys or hides the pane depending on its flags.
  
          :param `pane_info`: a :class:`AuiPaneInfo` instance.
docstring_summary: Destroys or hides the pane depending on its flags.
docstring_tokens: Destroys or hides the pane depending on its flags .
function: def ClosePane(self, pane_info):
          """
          Destroys or hides the pane depending on its flags.
  
          :param `pane_info`: a :class:`AuiPaneInfo` instance.
          """
  
          # if we were maximized, restore
          if pane_info.IsMaximized():
              self.RestorePane(pane_info)
  
          if pane_info.frame:
              if self._agwFlags & AUI_MGR_ANIMATE_FRAMES:
                  pane_info.frame.FadeOut()
  
          # first, hide the window
          if pane_info.window and pane_info.window.IsShown():
              pane_info.window.Show(False)
  
          # make sure that we are the parent of this window
          if pane_info.window and pane_info.window.GetParent() != self._frame:
              pane_info.window.Reparent(self._frame)
  
          # if we have a frame, destroy it
          if pane_info.frame:
              pane_info.frame.Destroy()
              pane_info.frame = None
  
          elif pane_info.IsNotebookPage():
              # if we are a notebook page, remove ourselves...
              # the  code would index out of bounds
              # if the last page of a sub-notebook was closed
              # because the notebook would be deleted, before this
              # code is executed.
              # This code just prevents an out-of bounds error.
              if self._notebooks:
                  nid = pane_info.notebook_id
                  if nid >= 0 and nid < len(self._notebooks):
                      notebook = self._notebooks[nid]
                      page_idx = notebook.GetPageIndex(pane_info.window)
                      if page_idx >= 0:
                          notebook.RemovePage(page_idx)
  
          # now we need to either destroy or hide the pane
          to_destroy = 0
          if pane_info.IsDestroyOnClose():
              to_destroy = pane_info.window
              self.DetachPane(to_destroy)
          else:
              if isinstance(pane_info.window, auibar.AuiToolBar) and pane_info.IsFloating():
                  tb = pane_info.window
                  if pane_info.dock_direction in [AUI_DOCK_LEFT, AUI_DOCK_RIGHT]:
                      tb.SetAGWWindowStyleFlag(tb.GetAGWWindowStyleFlag() | AUI_TB_VERTICAL)
  
              pane_info.Dock().Hide()
  
          if pane_info.IsNotebookControl():
  
              notebook = self._notebooks[pane_info.notebook_id]
              while notebook.GetPageCount():
                  window = notebook.GetPage(0)
                  notebook.RemovePage(0)
                  info = self.GetPane(window)
                  if info.IsOk():
                      info.notebook_id = -1
                      info.dock_direction = AUI_DOCK_NONE
                      # Note: this could change our paneInfo reference ...
                      self.ClosePane(info)
  
          if to_destroy:
              to_destroy.Destroy()
function_tokens: def ClosePane ( self , pane_info ) : # if we were maximized, restore if pane_info . IsMaximized ( ) : self . RestorePane ( pane_info ) if pane_info . frame : if self . _agwFlags & AUI_MGR_ANIMATE_FRAMES : pane_info . frame . FadeOut ( ) # first, hide the window if pane_info . window and pane_info . window . IsShown ( ) : pane_info . window . Show ( False ) # make sure that we are the parent of this window if pane_info . window and pane_info . window . GetParent ( ) != self . _frame : pane_info . window . Reparent ( self . _frame ) # if we have a frame, destroy it if pane_info . frame : pane_info . frame . Destroy ( ) pane_info . frame = None elif pane_info . IsNotebookPage ( ) : # if we are a notebook page, remove ourselves... # the  code would index out of bounds # if the last page of a sub-notebook was closed # because the notebook would be deleted, before this # code is executed. # This code just prevents an out-of bounds error. if self . _notebooks : nid = pane_info . notebook_id if nid >= 0 and nid < len ( self . _notebooks ) : notebook = self . _notebooks [ nid ] page_idx = notebook . GetPageIndex ( pane_info . window ) if page_idx >= 0 : notebook . RemovePage ( page_idx ) # now we need to either destroy or hide the pane to_destroy = 0 if pane_info . IsDestroyOnClose ( ) : to_destroy = pane_info . window self . DetachPane ( to_destroy ) else : if isinstance ( pane_info . window , auibar . AuiToolBar ) and pane_info . IsFloating ( ) : tb = pane_info . window if pane_info . dock_direction in [ AUI_DOCK_LEFT , AUI_DOCK_RIGHT ] : tb . SetAGWWindowStyleFlag ( tb . GetAGWWindowStyleFlag ( ) | AUI_TB_VERTICAL ) pane_info . Dock ( ) . Hide ( ) if pane_info . IsNotebookControl ( ) : notebook = self . _notebooks [ pane_info . notebook_id ] while notebook . GetPageCount ( ) : window = notebook . GetPage ( 0 ) notebook . RemovePage ( 0 ) info = self . GetPane ( window ) if info . IsOk ( ) : info . notebook_id = - 1 info . dock_direction = AUI_DOCK_NONE # Note: this could change our paneInfo reference ... self . ClosePane ( info ) if to_destroy : to_destroy . Destroy ( )