Author: bugman Date: Mon Jun 20 19:10:46 2011 New Revision: 13134 URL: http://svn.gna.org/viewcvs/relax?rev=13134&view=rev Log: The ok() method executed by the ok wizard button is now a wizard method which destroys the window. Modified: branches/gui_testing/gui/wizard.py Modified: branches/gui_testing/gui/wizard.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/wizard.py?rev=13134&r1=13133&r2=13134&view=diff ============================================================================== --- branches/gui_testing/gui/wizard.py (original) +++ branches/gui_testing/gui/wizard.py Mon Jun 20 19:10:46 2011 @@ -618,20 +618,6 @@ return field - def ok(self, event): - """Accept the operation. - - @param event: The wx event. - @type event: wx event - """ - - # Execute the apply method. - self.apply(event) - - # Then close. - self.Close() - - def text(self, sizer, desc, default=''): """Build the input field. @@ -805,7 +791,7 @@ button.SetToolTipString("Accept the operation") button.SetSize(self.size_button) self.button_sizers[i].Add(button, 0, wx.ADJUST_MINSIZE, 0) - self.Bind(wx.EVT_BUTTON, self.pages[i].ok, button) + self.Bind(wx.EVT_BUTTON, self.ok, button) # The finish button (only for the last page with multi-pages). if num_pages > 1 and i == num_pages - 1: @@ -814,7 +800,7 @@ button.SetToolTipString("Accept the operation") button.SetSize(self.size_button) self.button_sizers[i].Add(button, 0, wx.ADJUST_MINSIZE, 0) - self.Bind(wx.EVT_BUTTON, self.pages[i].ok, button) + self.Bind(wx.EVT_BUTTON, self.ok, button) # Spacer. self.button_sizers[i].AddSpacer(15) @@ -886,6 +872,20 @@ self.display_page(self.current_page) + def ok(self, event): + """Accept the operation. + + @param event: The wx event. + @type event: wx event + """ + + # Execute the apply method. + self.pages[self.current_page].apply(event) + + # Then destroy the dialog. + self.Destroy() + + def run(self): """Execute the wizard."""