parameters: (self, event)
docstring: Closes and deletes the current view and document.
docstring_summary: Closes and deletes the current view and document.
docstring_tokens: Closes and deletes the current view and document .
function: def OnCloseWindow(self, event):
          """
          Closes and deletes the current view and document.
          """
          if self._childView:
              ans = False
              if not event.CanVeto():
                  ans = True
              else:
                  ans = self._childView.Close(deleteWindow = False)
  
              if ans:
                  self._childView.Activate(False)
                  self._childView.Destroy()
                  self._childView = None
                  if self._childDocument:
                      self._childDocument.Destroy()  # This isn't in the wxWindows codebase but the document needs to be disposed of somehow
                  self._childDocument = None
                  self.Destroy()
              else:
                  event.Veto()
          else:
              event.Veto()
function_tokens: def OnCloseWindow ( self , event ) : if self . _childView : ans = False if not event . CanVeto ( ) : ans = True else : ans = self . _childView . Close ( deleteWindow = False ) if ans : self . _childView . Activate ( False ) self . _childView . Destroy ( ) self . _childView = None if self . _childDocument : self . _childDocument . Destroy ( ) # This isn't in the wxWindows codebase but the document needs to be disposed of somehow self . _childDocument = None self . Destroy ( ) else : event . Veto ( ) else : event . Veto ( )