]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/_extras.py
it is now possible to add custom buttons into wxHtmlHelpFrame's toolbar
[wxWidgets.git] / utils / wxPython / src / _extras.py
index 686803f320c2c1b47c66a7e73398b098a4a2a8e8..cad11d21a1cbf7892b7039deb30de587ac8ca816 100644 (file)
@@ -733,15 +733,18 @@ class wxPyOnDemandOutputWindow:
         self.frame  = None
         self.title  = title
 
+
     def SetParent(self, parent):
         self.parent = parent
 
+
     def OnCloseWindow(self, event):
         if self.frame != None:
             self.frame.Destroy()
         self.frame = None
         self.text  = None
 
+
     # this provides the file-like behaviour
     def write(self, str):
         if not self.frame:
@@ -753,7 +756,10 @@ class wxPyOnDemandOutputWindow:
             EVT_CLOSE(self.frame, self.OnCloseWindow)
         self.text.AppendText(str)
 
+
     def close(self):
+        if self.frame != None:
+            self.frame.Destroy()
         self.frame = None
         self.text  = None
 
@@ -789,19 +795,22 @@ class wxApp(wxPyApp):
     def SetTopWindow(self, frame):
         if self.stdioWin:
             self.stdioWin.SetParent(frame)
-            sys.stdout = self.stdioWin #sys.stderr =
+            sys.stderr = sys.stdout = self.stdioWin
         wxPyApp.SetTopWindow(self, frame)
 
+
     def MainLoop(self):
         wxPyApp.MainLoop(self)
         self.RestoreStdio()
 
+
     def RedirectStdio(self, filename):
         if filename:
             sys.stdout = sys.stderr = open(filename, 'a')
         else:
             self.stdioWin = self.outputWindowClass() # wxPyOnDemandOutputWindow
 
+
     def RestoreStdio(self):
         sys.stdout, sys.stderr = self.saveStdio
         if self.stdioWin != None: