mailr14562 - /1.3/gui/components/relax_data.py


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

Header


Content

Posted by edward on September 01, 2011 - 11:57:
Author: bugman
Date: Thu Sep  1 11:57:41 2011
New Revision: 14562

URL: http://svn.gna.org/viewcvs/relax?rev=14562&view=rev
Log:
All of the major GUI and X freeze fixes of r14559:14561 have been ported to 
the relax data list.

The fixes for the spectrum list GUI element are now present in the relaxation 
data list GUI element
as well, as the same problems occur in both code paths.


Modified:
    1.3/gui/components/relax_data.py

Modified: 1.3/gui/components/relax_data.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/components/relax_data.py?rev=14562&r1=14561&r2=14562&view=diff
==============================================================================
--- 1.3/gui/components/relax_data.py (original)
+++ 1.3/gui/components/relax_data.py Thu Sep  1 11:57:41 2011
@@ -148,6 +148,17 @@
     def build_element(self):
         """Build the relaxation data listing grid."""
 
+        # Execution lock, so do nothing.
+        if status.exec_lock.locked():
+            return
+
+        # Build the GUI element in a thread safe way.
+        wx.CallAfter(self.build_element_safe)
+
+
+    def build_element_safe(self):
+        """Build the spectra listing GUI element in a thread safe 
wx.CallAfter call."""
+
         # First freeze the element, so that the GUI element doesn't update 
until the end.
         self.element.Freeze()
 
@@ -248,7 +259,10 @@
         n = self.element.GetColumnCount()
 
         # Set to equal sizes.
-        width = int(x / n)
+        if n == 0:
+            width = x
+        else:
+            width = int(x / n)
 
         # Set the column sizes.
         for i in range(n):




Related Messages


Powered by MHonArc, Updated Thu Sep 01 13:00:02 2011