Author: bugman Date: Wed Sep 19 10:53:11 2012 New Revision: 17498 URL: http://svn.gna.org/viewcvs/relax?rev=17498&view=rev Log: Modified the operation of the sequence GUI element to have access to the sequence editor window. This is to allow this GUI element to be blasted within the test suite. Modified: trunk/gui/input_elements/sequence.py Modified: trunk/gui/input_elements/sequence.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/input_elements/sequence.py?rev=17498&r1=17497&r2=17498&view=diff ============================================================================== --- trunk/gui/input_elements/sequence.py (original) +++ trunk/gui/input_elements/sequence.py Wed Sep 19 10:53:11 2012 @@ -334,19 +334,21 @@ @type event: wx event """ - # Initialise the model selection window. - win = Sequence_window(parent=self.parent, name=self.name, seq_type=self.seq_type, value_type=self.value_type, dim=self.dim) - - # Set the model selector window selections. - win.SetValue(self.GetValue()) - - # Show the model selector window. - if status.show_gui: - win.ShowModal() - win.Close() + # 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_data(self): + """Extract the data from the selection window.""" # Get the value. - value = win.GetValue() + value = self.sel_win.GetValue() # No sequence data. if not len(value): @@ -356,8 +358,20 @@ else: self.SetValue(value) - # Destroy the window. - del win + + def selection_win_show(self): + """Show the selection window.""" + + # Initialise the model selection window. + self.sel_win = Sequence_window(parent=self.parent, name=self.name, seq_type=self.seq_type, value_type=self.value_type, dim=self.dim) + + # Set the model selector window selections. + self.sel_win.SetValue(self.GetValue()) + + # Show the model selector window. + if status.show_gui: + self.sel_win.ShowModal() + self.sel_win.Close()