/Doc/alert_funcs.html

https://bitbucket.org/alsh/pygui-mirror · HTML · 117 lines · 115 code · 2 blank · 0 comment · 0 complexity · 3753d959eea01c54c63068bf211071af MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  2. <html><head><title>Alert Functions</title>
  3. <meta name="GENERATOR" content="Mozilla/3.01Gold (X11; I; SunOS 5.6 sun4u) [Netscape]"></head>
  4. <body>
  5. <h1>Alert Functions</h1>
  6. These functions display various commonly-used types of modal dialog containing
  7. a textual message.<br>
  8. <h2>Alert kinds</h2>
  9. The <tt>kind</tt> parameter in the following functions determines the appearance
  10. of the dialog. It may take the following values:<br>
  11. <blockquote> <dl>
  12. <dt><tt>'stop'</tt></dt>
  13. <dd>Used for displaying an error message or other condition which prevents
  14. an operation from being completed.</dd>
  15. </dl>
  16. <dl>
  17. <dt><tt>'caution'</tt></dt>
  18. <dd>Used for warning the user when an operation could cause loss of data
  19. or other undesirable effects.</dd>
  20. </dl>
  21. <dl>
  22. <dt><tt>'note'</tt></dt>
  23. <dd>Used for presenting an informational message to the user.</dd>
  24. </dl>
  25. <dl>
  26. <dt><tt>'query'</tt></dt>
  27. <dd>Used for requesting information from the user.</dd>
  28. </dl>
  29. </blockquote>
  30. Some platforms may not display all of these in a unique way.<br>
  31. <h2>Low-level alert functions</h2>
  32. <dl>
  33. <dl>
  34. <dt><tt>alert(kind, message, ok_label = "OK")</tt></dt>
  35. <dd>Displays an alert box with one button, which is the default button.
  36. Does not return a value.</dd>
  37. </dl>
  38. </dl>
  39. <dl>
  40. <dl>
  41. <dt><tt>alert2(kind,&nbsp;</tt><tt>message</tt><tt>, yes_label = "Yes",
  42. no_label = "No",</tt></dt>
  43. <dt><tt>&nbsp; &nbsp; &nbsp; &nbsp;default = 1, cancel = 0)</tt></dt>
  44. <dd>Displays an alert box with two buttons. Returns 1 if the "yes" button
  45. is pressed, 0 if the "no" button is pressed. The <tt>default</tt> and <tt>cancel</tt>&nbsp;parameters&nbsp;specify
  46. which buttons, if any, are activated by the standard keyboard equivalents,
  47. and take the values <tt>1</tt>, <tt>0</tt> or <tt>None</tt>.</dd>
  48. </dl>
  49. </dl>
  50. <dl>
  51. <dl>
  52. <dt><tt>alert3(kind, message, yes_label = "Yes", no_label = "No", <br>
  53. &nbsp; &nbsp; &nbsp; &nbsp;other_label = "Cancel", </tt><tt>default = 1,
  54. cancel = -1</tt><tt>)</tt></dt>
  55. <dd>Displays an alert box with three buttons. Returns 1 if the "yes" button
  56. is pressed, 0 if the "no" button is pressed, and -1 if the "other" button
  57. is pressed.&nbsp; The <tt>default</tt> and <tt>cancel</tt> parameters specify
  58. which buttons, if any, are activated by the standard keyboard equivalents,
  59. and take the values <tt>1</tt>, <tt>0</tt>, <tt>-1</tt> or <tt>None</tt>.</dd>
  60. </dl>
  61. </dl>
  62. In addition to the parameters listed above, these functions also accept the
  63. following optional parameters:<br>
  64. <blockquote>
  65. <dl>
  66. <dt><tt>width</tt></dt>
  67. <dd>The overall width of the alert box.</dd>
  68. </dl>
  69. <dl>
  70. <dt><tt>lines</tt></dt>
  71. <dd>The number of lines to allow for in the text area of the alert box.</dd>
  72. </dl>
  73. </blockquote>
  74. These parameters are hints only; platforms are free to
  75. ignore them and calculate the size of the alert box from the text
  76. provided.<br>
  77. <h2>High-level alert functions</h2>
  78. The following functions provide shorthands for calling the above functions
  79. with certain common combinations of parameters.<br>
  80. <dl>
  81. <dl>
  82. <dt><tt>note_alert(message,</tt> ...<tt>)</tt></dt>
  83. <dd>Equivalent to <tt>alert('note', message,</tt> ...<tt>)</tt>.</dd>
  84. </dl>
  85. </dl>
  86. <blockquote> <dl>
  87. <dt><tt>stop_alert(message,</tt> ...<tt>)</tt></dt>
  88. <dd>Equivalent to <tt>alert('stop', message,</tt> ...<tt>)</tt>.</dd>
  89. </dl>
  90. </blockquote>
  91. <dl>
  92. <dl>
  93. <dt><tt>ask(message,</tt> ...<tt>)</tt></dt>
  94. <dd>Equivalent to <tt>alert2('query', message,</tt> ...<tt>)</tt>.</dd>
  95. </dl>
  96. </dl>
  97. <blockquote> <dl>
  98. <dt><tt>confirm(message,</tt> ...<tt>)</tt></dt>
  99. <dd>Equivalent to <tt>alert2('caution', message,</tt> ...<tt>)</tt>.</dd>
  100. </dl>
  101. </blockquote>
  102. <blockquote> <dl>
  103. <dt><tt>ask_or_cancel(message,</tt> ...<tt>)</tt></dt>
  104. <dd>Equivalent to <tt>alert3('query', message,</tt> ...<tt>)</tt>.</dd>
  105. </dl>
  106. </blockquote>
  107. <dl>
  108. <dl>
  109. <dt><tt>confirm_or_cancel(message,</tt> ...<tt>)</tt></dt>
  110. <dd>Equivalent to <tt>alert3('caution', message,</tt> ...<tt>)</tt>.</dd>
  111. </dl>
  112. </dl>
  113. ---<br>
  114. <br>
  115. </body></html>