/Doc/ModalDialog.html

https://bitbucket.org/alsh/pygui-mirror · HTML · 40 lines · 39 code · 1 blank · 0 comment · 0 complexity · 7d8335f49d314c794644d5694ff8e64d MD5 · raw file

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html><head><title>PyGUI - ModalDialog class</title>
  3. <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"></head>
  4. <body>
  5. <h1>class <tt>ModalDialog(Dialog)</tt></h1>
  6. The ModalDialog class is a subclass of <a href="Dialog.html">Dialog</a>
  7. designed for modal dialogs. It has a default style of <tt>'modal_dialog'</tt>
  8. and provides facilities for presenting the dialog modally.<br>
  9. <br>
  10. While a ModalDialog is active, interaction with other parts of the application
  11. is prevented. Other windows cannot be activated, application-wide menu commands
  12. other than those used by the dialog itself are not enabled, and unhandled
  13. events and messages are not forwarded to the application.<br>
  14. <h2>Constructor</h2>
  15. <blockquote> <dl>
  16. <dt><tt>ModalDialog(style</tt> <tt>=</tt> <tt>'modal_dialog',</tt></dt>
  17. <dt><tt>&nbsp; &nbsp; </tt><tt>closable</tt> <tt>=</tt> <tt>False,</tt> <tt>resizable</tt> <tt>=</tt> <tt>False,</tt> <tt>zoomable</tt> = <tt>False</tt><tt>,</tt></dt>
  18. <dt><tt>&nbsp; &nbsp; movable</tt> <tt>=</tt> <i>default</i><tt>,</tt> <tt>hidable</tt> =&nbsp;<i>default</i><tt>)</tt></dt>
  19. <dd><br>Constructs a ModalDialog with the specified options. The default values
  20. for the <tt>movable</tt> and <tt>hidable</tt> options are platform-dependent.</dd>
  21. </dl>
  22. </blockquote>
  23. <h2>Methods</h2>
  24. <blockquote> <dl>
  25. <dt><tt>present()</tt></dt>
  26. <dd>Present the dialog modally. The dialog is shown and a nested event
  27. loop is entered which prevents interaction with any other part of the application.
  28. This method retains control until the dialog's <tt>dismiss()</tt> method is
  29. called. The dialog is then hidden and the <span style="font-family: monospace;">present()</span> method returns with the value passed to <tt>dismiss()</tt>.<br>
  30. </dd>
  31. </dl>
  32. </blockquote>
  33. <blockquote> <dl>
  34. <dt><tt>dismiss(result</tt> <tt>=</tt> <tt>0)</tt></dt>
  35. <dd>Hides the dialog and, if the dialog is being presented modally, causes the <tt>present()</tt> method to return with the given result as its return value.<br><br></dd><dt style="font-family: monospace;">ok()</dt><dd>Dismisses the dialog with the value <span style="font-family: monospace;">True</span>. By default, this method is called in response to pressing a <a href="Button.html#DefaultButton">DefaultButton</a> or&nbsp;a Return/Enter key event.<br><br></dd><dt style="font-family: monospace;">cancel()</dt><dd>Dismisses the dialog with the value <span style="font-family: monospace;">False</span>. By default, this method is called in response to pressing a&nbsp;<a href="Button.html#CancelButton">CancelButton</a> or&nbsp;an Escape key event.</dd>
  36. </dl>
  37. </blockquote>
  38. ---
  39. </body></html>