Author: bugman Date: Fri May 18 16:10:27 2012 New Revision: 16342 URL: http://svn.gna.org/viewcvs/relax?rev=16342&view=rev Log: Fix for the Sequence_2D GUI element for when the first dimension is variable but the second is fixed. This allows the bmrb.citation GUI user function 'authors' argument element to be functional. Modified: branches/uf_redesign/gui/input_elements/sequence.py branches/uf_redesign/gui/input_elements/sequence_2D.py Modified: branches/uf_redesign/gui/input_elements/sequence.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/input_elements/sequence.py?rev=16342&r1=16341&r2=16342&view=diff ============================================================================== --- branches/uf_redesign/gui/input_elements/sequence.py (original) +++ branches/uf_redesign/gui/input_elements/sequence.py Fri May 18 16:10:27 2012 @@ -453,7 +453,7 @@ sizer.Add(button_sizer, 0, wx.ALIGN_CENTER|wx.ALL, 0) # The non-fixed sequence buttons. - if not self.dim: + if self.dim == None or (isinstance(self.dim, tuple) and self.dim[0] == None): # The add button. button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Add") button.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.add, wx.BITMAP_TYPE_ANY)) Modified: branches/uf_redesign/gui/input_elements/sequence_2D.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/input_elements/sequence_2D.py?rev=16342&r1=16341&r2=16342&view=diff ============================================================================== --- branches/uf_redesign/gui/input_elements/sequence_2D.py (original) +++ branches/uf_redesign/gui/input_elements/sequence_2D.py Fri May 18 16:10:27 2012 @@ -235,7 +235,7 @@ # Loop over the entries. for i in range(len(values)): # Fixed dimension sequences - set the first value of the pre-created list. - if self.dim: + if self.dim[0] != None: self.sequence.SetStringItem(index=i, col=0, label=self.convert_to_gui(values[i][0])) # Variable dimension sequences - append the first value to the end of the blank list. @@ -273,6 +273,6 @@ sizer.Add(self.sequence, 1, wx.ALL|wx.EXPAND, 0) # The fixed dimension sequence - add all the rows needed. - if self.dim: + if self.dim[0] != None: for i in range(self.dim[0]): self.append_row(None)