Author: bugman Date: Thu Sep 1 11:49:42 2011 New Revision: 14560 URL: http://svn.gna.org/viewcvs/relax?rev=14560&view=rev Log: Bug fix for the freezing of X windows! The spectrum list GUI element is now updated with a CallAfter call so that the element is updated in a thread safe way. Without this, the entire X windows system would sometimes freeze!!! Modified: 1.3/gui/components/spectrum.py Modified: 1.3/gui/components/spectrum.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/components/spectrum.py?rev=14560&r1=14559&r2=14560&view=diff ============================================================================== --- 1.3/gui/components/spectrum.py (original) +++ 1.3/gui/components/spectrum.py Thu Sep 1 11:49:42 2011 @@ -146,6 +146,13 @@ 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() @@ -181,12 +188,12 @@ if self.replicates(index): index += 1 - # Size the columns. - self.size_cols() - # Post a size event to get the scroll panel to update correctly. event = wx.PyCommandEvent(wx.EVT_SIZE.typeId, self.parent.GetId()) wx.PostEvent(self.parent.GetEventHandler(), event) + + # Size the columns. + self.size_cols() # Set the minimum height. height = self.height_char * (n + 1) + 50