Author: bugman Date: Wed May 28 11:19:56 2014 New Revision: 23495 URL: http://svn.gna.org/viewcvs/relax?rev=23495&view=rev Log: Modification to the Sequence_2D GUI element used for some user function windows. The selection_win_show() method has been redefined, as the parent method from the Sequence element is specific for the 1D sequence module. The open_dialog() method has also been modified to use the new selection_win_show(), as well as the parent Sequence class selection_win_data() method. Modified: trunk/gui/input_elements/sequence_2D.py Modified: trunk/gui/input_elements/sequence_2D.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/input_elements/sequence_2D.py?rev=23495&r1=23494&r2=23495&view=diff ============================================================================== --- trunk/gui/input_elements/sequence_2D.py (original) +++ trunk/gui/input_elements/sequence_2D.py Wed May 28 11:19:56 2014 @@ -107,30 +107,29 @@ @type event: wx event """ - # Initialise the model selection window. - win = Sequence_window_2D(name=self.name, seq_type=self.seq_type, value_type=self.value_type, titles=self.titles, dim=self.dim) - - # Set the model selector window selections. - win.SetValue(self.GetValue()) - - # Show the model selector window. + # Show the window. + self.selection_win_show() + + # Extract the data from the selection window once closed. + self.selection_win_data() + + # Destroy the window. + del self.sel_win + + + def selection_win_show(self): + """Show the selection window.""" + + # Initialise the window. + self.sel_win = Sequence_window_2D(name=self.name, seq_type=self.seq_type, value_type=self.value_type, titles=self.titles, dim=self.dim) + + # Set the values. + self.sel_win.SetValue(self.GetValue()) + + # Show the window. if status.show_gui: - win.ShowModal() - win.Close() - - # Get the value. - value = win.GetValue() - - # No sequence data. - if not len(value): - self.Clear() - - # Set the values. - else: - self.SetValue(value) - - # Destroy the window. - del win + self.sel_win.ShowModal() + self.sel_win.Close()