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