mailr13536 - /branches/gui_testing/gui/wizard.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on July 08, 2011 - 14:43:
Author: bugman
Date: Fri Jul  8 14:43:52 2011
New Revision: 13536

URL: http://svn.gna.org/viewcvs/relax?rev=13536&view=rev
Log:
The wizard can now be run as either a modal or modeless dialog.


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=13536&r1=13535&r2=13536&view=diff
==============================================================================
--- branches/gui_testing/gui/wizard.py (original)
+++ branches/gui_testing/gui/wizard.py Fri Jul  8 14:43:52 2011
@@ -1203,11 +1203,13 @@
                 button.Enable()
 
 
-    def run(self):
+    def run(self, modal=False):
         """Execute the wizard.
 
-        @return:    The status, i.e. True if the wizard is run, False if 
cancelled or other error occur.
-        @rtype:     bool
+        @keyword modal: A flag which if True will cause the wizard to be run 
as a modal dialog.
+        @type modal:    bool
+        @return:        The status from the modal operation, i.e. True if 
the wizard is run, False if cancelled or other error occur.  For modeless 
operation, this returns nothing.
+        @rtype:         bool or None
         """
 
         # Build the buttons for the entire wizard.
@@ -1216,11 +1218,18 @@
         # Display the first page.
         self._display_page(0)
 
-        # Show the wizard.
-        self.ShowModal()
-
-        # Destroy the wizard.
-        self.Destroy()
-
-        # Return the status.
-        return self._status
+        # Modal operation.
+        if modal:
+            # Show the wizard.
+            self.ShowModal()
+
+            # Destroy the wizard.
+            self.Destroy()
+
+            # Return the status.
+            return self._status
+
+        # Modeless operation.
+        else:
+            # Show the wizard.
+            self.Show()




Related Messages


Powered by MHonArc, Updated Fri Jul 08 15:00:02 2011