Author: bugman
Date: Thu Jan 28 11:33:49 2010
New Revision: 10481
URL: http://svn.gna.org/viewcvs/relax?rev=10481&view=rev
Log:
The controller close button now works better.
The method close_log() is now called handler_close().  Instead of calling 
self.Destroy(), it now
calls self.Close() allowing the controller to be re-opened.
Modified:
    branches/bieri_gui/gui_bieri/controller.py
Modified: branches/bieri_gui/gui_bieri/controller.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/controller.py?rev=10481&r1=10480&r2=10481&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/controller.py (original)
+++ branches/bieri_gui/gui_bieri/controller.py Thu Jan 28 11:33:49 2010
@@ -127,7 +127,7 @@
 
         # Button actions
         self.Bind(wx.EVT_BUTTON, self.cancel_calculation, self.cancel_button)
-        self.Bind(wx.EVT_BUTTON, self.close_log, self.close_button)
+        self.Bind(wx.EVT_BUTTON, self.handler_close, self.close_button)
 
         # Start Calculation in Thread
         #if WHICH_CALC == 'Rx':
@@ -179,10 +179,15 @@
         event.Skip()
 
 
-    def close_log(self, event): # Close window
-        self.Destroy()
-        sys.stdout = sys.stdout
-        sys.stderr = sys.stderr
-        #sys.exit(2)
-        return ''
+    def handler_close(self, event):
+        """Event handler for the close window action.
+
+        @param event:   The wx event.
+        @type event:    wx event
+        """
+
+        # Close the window.
+        self.Close()
+
+        # Terminate the event.
         event.Skip()