Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="form-objects.html" /> | |
13 | <link rel="prev" href="module-fl.html" /> | |
14 | <link rel="parent" href="module-fl.html" /> | |
15 | <link rel="next" href="form-objects.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>20.4.1 Functions Defined in Module fl</title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="20.4 fl " | |
25 | href="module-fl.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="20.4 fl " | |
28 | href="module-fl.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="20.4.2 Form Objects" | |
31 | href="form-objects.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Library Reference</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
38 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="module-fl.html">20.4 fl </A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="module-fl.html">20.4 fl </A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="form-objects.html">20.4.2 Form Objects</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H2><A NAME="SECTION0022410000000000000000"> | |
56 | 20.4.1 Functions Defined in Module <tt class="module">fl</tt></A> | |
57 | </H2> | |
58 | <A NAME="FL_Functions"></A> | |
59 | <P> | |
60 | Module <tt class="module">fl</tt> defines the following functions. For more | |
61 | information about what they do, see the description of the equivalent | |
62 | C function in the FORMS documentation: | |
63 | ||
64 | <P> | |
65 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
66 | <td><nobr><b><tt id='l2h-5114' xml:id='l2h-5114' class="function">make_form</tt></b>(</nobr></td> | |
67 | <td><var>type, width, height</var>)</td></tr></table></dt> | |
68 | <dd> | |
69 | Create a form with given type, width and height. This returns a | |
70 | <i class="dfn">form</i> object, whose methods are described below. | |
71 | </dl> | |
72 | ||
73 | <P> | |
74 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
75 | <td><nobr><b><tt id='l2h-5115' xml:id='l2h-5115' class="function">do_forms</tt></b>(</nobr></td> | |
76 | <td><var></var>)</td></tr></table></dt> | |
77 | <dd> | |
78 | The standard FORMS main loop. Returns a Python object representing | |
79 | the FORMS object needing interaction, or the special value | |
80 | <tt class="constant">FL.EVENT</tt>. | |
81 | </dl> | |
82 | ||
83 | <P> | |
84 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
85 | <td><nobr><b><tt id='l2h-5116' xml:id='l2h-5116' class="function">check_forms</tt></b>(</nobr></td> | |
86 | <td><var></var>)</td></tr></table></dt> | |
87 | <dd> | |
88 | Check for FORMS events. Returns what <tt class="function">do_forms()</tt> above | |
89 | returns, or <code>None</code> if there is no event that immediately needs | |
90 | interaction. | |
91 | </dl> | |
92 | ||
93 | <P> | |
94 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
95 | <td><nobr><b><tt id='l2h-5117' xml:id='l2h-5117' class="function">set_event_call_back</tt></b>(</nobr></td> | |
96 | <td><var>function</var>)</td></tr></table></dt> | |
97 | <dd> | |
98 | Set the event callback function. | |
99 | </dl> | |
100 | ||
101 | <P> | |
102 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
103 | <td><nobr><b><tt id='l2h-5118' xml:id='l2h-5118' class="function">set_graphics_mode</tt></b>(</nobr></td> | |
104 | <td><var>rgbmode, doublebuffering</var>)</td></tr></table></dt> | |
105 | <dd> | |
106 | Set the graphics modes. | |
107 | </dl> | |
108 | ||
109 | <P> | |
110 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
111 | <td><nobr><b><tt id='l2h-5119' xml:id='l2h-5119' class="function">get_rgbmode</tt></b>(</nobr></td> | |
112 | <td><var></var>)</td></tr></table></dt> | |
113 | <dd> | |
114 | Return the current rgb mode. This is the value of the C global | |
115 | variable <tt class="cdata">fl_rgbmode</tt>. | |
116 | </dl> | |
117 | ||
118 | <P> | |
119 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
120 | <td><nobr><b><tt id='l2h-5120' xml:id='l2h-5120' class="function">show_message</tt></b>(</nobr></td> | |
121 | <td><var>str1, str2, str3</var>)</td></tr></table></dt> | |
122 | <dd> | |
123 | Show a dialog box with a three-line message and an OK button. | |
124 | </dl> | |
125 | ||
126 | <P> | |
127 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
128 | <td><nobr><b><tt id='l2h-5121' xml:id='l2h-5121' class="function">show_question</tt></b>(</nobr></td> | |
129 | <td><var>str1, str2, str3</var>)</td></tr></table></dt> | |
130 | <dd> | |
131 | Show a dialog box with a three-line message and YES and NO buttons. | |
132 | It returns <code>1</code> if the user pressed YES, <code>0</code> if NO. | |
133 | </dl> | |
134 | ||
135 | <P> | |
136 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
137 | <td><nobr><b><tt id='l2h-5122' xml:id='l2h-5122' class="function">show_choice</tt></b>(</nobr></td> | |
138 | <td><var>str1, str2, str3, but1</var><big>[</big><var>, | |
139 | but2</var><big>[</big><var>, but3</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt> | |
140 | <dd> | |
141 | Show a dialog box with a three-line message and up to three buttons. | |
142 | It returns the number of the button clicked by the user | |
143 | (<code>1</code>, <code>2</code> or <code>3</code>). | |
144 | </dl> | |
145 | ||
146 | <P> | |
147 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
148 | <td><nobr><b><tt id='l2h-5123' xml:id='l2h-5123' class="function">show_input</tt></b>(</nobr></td> | |
149 | <td><var>prompt, default</var>)</td></tr></table></dt> | |
150 | <dd> | |
151 | Show a dialog box with a one-line prompt message and text field in | |
152 | which the user can enter a string. The second argument is the default | |
153 | input string. It returns the string value as edited by the user. | |
154 | </dl> | |
155 | ||
156 | <P> | |
157 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
158 | <td><nobr><b><tt id='l2h-5124' xml:id='l2h-5124' class="function">show_file_selector</tt></b>(</nobr></td> | |
159 | <td><var>message, directory, pattern, default</var>)</td></tr></table></dt> | |
160 | <dd> | |
161 | Show a dialog box in which the user can select a file. It returns | |
162 | the absolute filename selected by the user, or <code>None</code> if the user | |
163 | presses Cancel. | |
164 | </dl> | |
165 | ||
166 | <P> | |
167 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
168 | <td><nobr><b><tt id='l2h-5125' xml:id='l2h-5125' class="function">get_directory</tt></b>(</nobr></td> | |
169 | <td><var></var>)</td></tr></table></dt> | |
170 | <dd> | |
171 | <dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
172 | <td><nobr><b><tt class="function">get_pattern</tt></b>(</nobr></td> | |
173 | <td><var></var>)</td></tr></table></dt> | |
174 | <dd><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
175 | <td><nobr><b><tt class="function">get_filename</tt></b>(</nobr></td> | |
176 | <td><var></var>)</td></tr></table></dt> | |
177 | <dd>These functions return the directory, pattern and filename (the tail | |
178 | part only) selected by the user in the last | |
179 | <tt class="function">show_file_selector()</tt> call. | |
180 | </dl> | |
181 | ||
182 | <P> | |
183 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
184 | <td><nobr><b><tt id='l2h-5128' xml:id='l2h-5128' class="function">qdevice</tt></b>(</nobr></td> | |
185 | <td><var>dev</var>)</td></tr></table></dt> | |
186 | <dd> | |
187 | <dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
188 | <td><nobr><b><tt class="function">unqdevice</tt></b>(</nobr></td> | |
189 | <td><var>dev</var>)</td></tr></table></dt> | |
190 | <dd><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
191 | <td><nobr><b><tt class="function">isqueued</tt></b>(</nobr></td> | |
192 | <td><var>dev</var>)</td></tr></table></dt> | |
193 | <dd><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
194 | <td><nobr><b><tt class="function">qtest</tt></b>(</nobr></td> | |
195 | <td><var></var>)</td></tr></table></dt> | |
196 | <dd><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
197 | <td><nobr><b><tt class="function">qread</tt></b>(</nobr></td> | |
198 | <td><var></var>)</td></tr></table></dt> | |
199 | <dd><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
200 | <td><nobr><b><tt class="function">qreset</tt></b>(</nobr></td> | |
201 | <td><var></var>)</td></tr></table></dt> | |
202 | <dd><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
203 | <td><nobr><b><tt class="function">qenter</tt></b>(</nobr></td> | |
204 | <td><var>dev, val</var>)</td></tr></table></dt> | |
205 | <dd><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
206 | <td><nobr><b><tt class="function">get_mouse</tt></b>(</nobr></td> | |
207 | <td><var></var>)</td></tr></table></dt> | |
208 | <dd><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
209 | <td><nobr><b><tt class="function">tie</tt></b>(</nobr></td> | |
210 | <td><var>button, valuator1, valuator2</var>)</td></tr></table></dt> | |
211 | <dd>These functions are the FORMS interfaces to the corresponding GL | |
212 | functions. Use these if you want to handle some GL events yourself | |
213 | when using <tt class="function">fl.do_events()</tt>. When a GL event is detected that | |
214 | FORMS cannot handle, <tt class="function">fl.do_forms()</tt> returns the special value | |
215 | <tt class="constant">FL.EVENT</tt> and you should call <tt class="function">fl.qread()</tt> to read | |
216 | the event from the queue. Don't use the equivalent GL functions! | |
217 | </dl> | |
218 | ||
219 | <P> | |
220 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
221 | <td><nobr><b><tt id='l2h-5137' xml:id='l2h-5137' class="function">color</tt></b>(</nobr></td> | |
222 | <td><var></var>)</td></tr></table></dt> | |
223 | <dd> | |
224 | <dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
225 | <td><nobr><b><tt class="function">mapcolor</tt></b>(</nobr></td> | |
226 | <td><var></var>)</td></tr></table></dt> | |
227 | <dd><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
228 | <td><nobr><b><tt class="function">getmcolor</tt></b>(</nobr></td> | |
229 | <td><var></var>)</td></tr></table></dt> | |
230 | <dd>See the description in the FORMS documentation of | |
231 | <tt class="cfunction">fl_color()</tt>, <tt class="cfunction">fl_mapcolor()</tt> and | |
232 | <tt class="cfunction">fl_getmcolor()</tt>. | |
233 | </dl> | |
234 | ||
235 | <P> | |
236 | ||
237 | <DIV CLASS="navigation"> | |
238 | <div class='online-navigation'> | |
239 | <p></p><hr /> | |
240 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
241 | <tr> | |
242 | <td class='online-navigation'><a rel="prev" title="20.4 fl " | |
243 | href="module-fl.html"><img src='../icons/previous.png' | |
244 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
245 | <td class='online-navigation'><a rel="parent" title="20.4 fl " | |
246 | href="module-fl.html"><img src='../icons/up.png' | |
247 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
248 | <td class='online-navigation'><a rel="next" title="20.4.2 Form Objects" | |
249 | href="form-objects.html"><img src='../icons/next.png' | |
250 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
251 | <td align="center" width="100%">Python Library Reference</td> | |
252 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
253 | href="contents.html"><img src='../icons/contents.png' | |
254 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
255 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
256 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
257 | <td class='online-navigation'><a rel="index" title="Index" | |
258 | href="genindex.html"><img src='../icons/index.png' | |
259 | border='0' height='32' alt='Index' width='32' /></A></td> | |
260 | </tr></table> | |
261 | <div class='online-navigation'> | |
262 | <b class="navlabel">Previous:</b> | |
263 | <a class="sectref" rel="prev" href="module-fl.html">20.4 fl </A> | |
264 | <b class="navlabel">Up:</b> | |
265 | <a class="sectref" rel="parent" href="module-fl.html">20.4 fl </A> | |
266 | <b class="navlabel">Next:</b> | |
267 | <a class="sectref" rel="next" href="form-objects.html">20.4.2 Form Objects</A> | |
268 | </div> | |
269 | </div> | |
270 | <hr /> | |
271 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
272 | </DIV> | |
273 | <!--End of Navigation Panel--> | |
274 | <ADDRESS> | |
275 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
276 | </ADDRESS> | |
277 | </BODY> | |
278 | </HTML> |