]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_app_ex.py
reSWIGged
[wxWidgets.git] / wxPython / src / _app_ex.py
index b843af61916f1b664ade5be61df6d13b7d096ba5..f3246fbcc638468d9b12c59d12e268fad77d819f 100644 (file)
@@ -23,11 +23,19 @@ class PyOnDemandOutputWindow:
                               style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
         self.text  = wx.TextCtrl(self.frame, -1, "",
                                  style = wx.TE_MULTILINE | wx.TE_READONLY)
+        self.text.AppendText(st)
         self.frame.SetSize((450, 300))
         self.frame.Show(True)
         EVT_CLOSE(self.frame, self.OnCloseWindow)
         
 
+    def OnCloseWindow(self, event):
+        if self.frame is not None:
+            self.frame.Destroy()
+        self.frame = None
+        self.text  = None
+
+
     # These methods provide the file-like output behaviour.
     def write(self, text):
         """
@@ -52,11 +60,6 @@ class PyOnDemandOutputWindow:
             wx.CallAfter(self.frame.Close)
 
 
-    def OnCloseWindow(self, event):
-        if self.frame is not None:
-            self.frame.Destroy()
-        self.frame = None
-        self.text  = None
 
 #----------------------------------------------------------------------
 
@@ -130,7 +133,7 @@ your Mac."""
         self.RestoreStdio()
 
 
-    def RedirectStdio(self, filename):
+    def RedirectStdio(self, filename=None):
         """Redirect sys.stdout and sys.stderr to a file or a popup window."""
         if filename:
             _sys.stdout = _sys.stderr = open(filename, 'a')