1. windwiny
  2. mygrsync

Commits

windwiny  committed 3c35cfc

on mainframe close, reset sys.stdout

  • Participants
  • Parent commits 2a64144
  • Branches master

Comments (0)

Files changed (1)

File mygrsyncframe.py

View file
               pos=wx.Point(580, 0), size=wx.Size(341, 148),
               style=wx.DEFAULT_FRAME_STYLE, title=u'mygrsync')
         self.SetClientSize(wx.Size(325, 110))
+        self.Bind(wx.EVT_CLOSE, self.OnMygrsyncClose)
 
         self.panel1 = wx.Panel(id=wxID_MYGRSYNCPANEL1, name='panel1',
               parent=self, pos=wx.Point(0, 0), size=wx.Size(325, 110),
         self._stdout, self._stderr = sys.stdout, sys.stderr
         sys.stdout, sys.stderr = self, self
 
+    def OnMygrsyncClose(self, event):
+        event.Skip()
+        sys.stdout, sys.stderr = self._stdout, self._stderr
+        print 'reset sys.stdout, mainframe close'
+
     def write(self, txt):
         if type(txt) == type(u''):
             pass
 
     def OnBtnExitButton(self, event):
         event.Skip()
-        self.Destroy()
+        self.Close()
 
     def OnTxt_x(self, event):
         event.Skip()