Author: bugman Date: Thu May 24 17:47:01 2012 New Revision: 16449 URL: http://svn.gna.org/viewcvs/relax?rev=16449&view=rev Log: Mac OS X bug fix for the non-read only ComboBox GUI input elements. This is for the Value and Combo_list GUI input elements. The problem was two-fold. First the convert_to_gui() call was required to convert the value to a unicode string, as a normal string will be not be set via the ComboBox.SetValue() method. Secondly old selections need to be turned off. On other operating systems, the SetValue() call will reset this - but not on Macs!!! Grrrrr...... Modified: branches/uf_redesign/gui/input_elements/combo_list.py branches/uf_redesign/gui/input_elements/value.py Modified: branches/uf_redesign/gui/input_elements/combo_list.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/input_elements/combo_list.py?rev=16449&r1=16448&r2=16449&view=diff ============================================================================== --- branches/uf_redesign/gui/input_elements/combo_list.py (original) +++ branches/uf_redesign/gui/input_elements/combo_list.py Thu May 24 17:47:01 2012 @@ -323,9 +323,10 @@ if self._read_only: raise RelaxError("The Value element is read only, cannot set the value '%s'." % value) - # Set the unknown value. + # Set the unknown value, and remove the selection. else: - self._combo_boxes[index].SetValue(value) + self._combo_boxes[index].SetSelection(wx.NOT_FOUND) + self._combo_boxes[index].SetValue(self.convert_to_gui(value)) # A list of values. else: Modified: branches/uf_redesign/gui/input_elements/value.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/input_elements/value.py?rev=16449&r1=16448&r2=16449&view=diff ============================================================================== --- branches/uf_redesign/gui/input_elements/value.py (original) +++ branches/uf_redesign/gui/input_elements/value.py Thu May 24 17:47:01 2012 @@ -313,9 +313,10 @@ if self.read_only: raise RelaxError("The Value element is read only, cannot set the value '%s'." % value) - # Set the unknown value. + # Set the unknown value, and remove the selection. else: - self._field.SetValue(value) + self._field.SetSelection(wx.NOT_FOUND) + self._field.SetValue(self.convert_to_gui(value)) def UpdateChoices(self, combo_choices=None, combo_data=None, combo_default=None):