mailr15993 - /branches/uf_redesign/gui/uf_objects.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on May 04, 2012 - 20:52:
Author: bugman
Date: Fri May  4 20:52:02 2012
New Revision: 15993

URL: http://svn.gna.org/viewcvs/relax?rev=15993&view=rev
Log:
The relax controller is now shown for the auto-generated GUI user functions 
if 'display' is set.

This is the 'display' variable in the user function data store.  This allows 
all the user functions
which print to STDOUT to pop up the controller in front of the user, so they 
see the result.


Modified:
    branches/uf_redesign/gui/uf_objects.py

Modified: branches/uf_redesign/gui/uf_objects.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/uf_objects.py?rev=15993&r1=15992&r2=15993&view=diff
==============================================================================
--- branches/uf_redesign/gui/uf_objects.py (original)
+++ branches/uf_redesign/gui/uf_objects.py Fri May  4 20:52:02 2012
@@ -26,6 +26,7 @@
 # Python module imports.
 from re import search
 from string import split
+from time import sleep
 import wx
 from wx.lib import scrolledpanel
 
@@ -388,8 +389,26 @@
             # Store the value.
             kargs[name] = self.GetValue(name)
 
-        # Set the name.
+        # Display the relax controller, if asked.
+        if self.uf_data.display:
+            # Get the App.
+            app = wx.GetApp()
+
+            # First show the controller.
+            app.gui.show_controller(None)
+
+            # Go to the last line.
+            app.gui.controller.log_panel.on_goto_end(None)
+
+            # Wait a little while.
+            sleep(0.5)
+
+        # Execute the user function.
         self.execute(self.name, **kargs)
+
+        # Bring the controller to the front.
+        if self.uf_data.display:
+            wx.CallAfter(app.gui.controller.Raise)
 
 
     def process_doc(self, doc):




Related Messages


Powered by MHonArc, Updated Sat May 05 21:00:02 2012