blob: 26133fde840b44102ce1d9729762ab3dd3049f02 [file] [log] [blame]
Fred Drake295da241998-08-10 19:42:37 +00001\section{\module{fl} ---
Fred Drakef6863c11999-03-02 16:37:17 +00002 FORMS library interface for GUI applications}
Fred Drakeb91e9341998-07-23 17:59:49 +00003
Fred Drakef6863c11999-03-02 16:37:17 +00004\declaremodule{builtin}{fl}
5 \platform{IRIX}
Fred Drakeb91e9341998-07-23 17:59:49 +00006\modulesynopsis{FORMS library interface for GUI applications.}
7
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00008
Fred Drake5f874d61998-03-15 01:59:57 +00009This module provides an interface to the FORMS Library\index{FORMS
10Library} by Mark Overmars\index{Overmars, Mark}. The source for the
11library can be retrieved by anonymous ftp from host
12\samp{ftp.cs.ruu.nl}, directory \file{SGI/FORMS}. It was last tested
13with version 2.0b.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000014
Fred Drakef6863c11999-03-02 16:37:17 +000015Most functions are literal translations of their C equivalents,
Guido van Rossum470be141995-03-17 16:07:09 +000016dropping the initial \samp{fl_} from their name. Constants used by
Fred Drake673c65e1999-04-29 18:42:18 +000017the library are defined in module \refmodule[fl-constants]{FL}
18described below.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000019
20The creation of objects is a little different in Python than in C:
21instead of the `current form' maintained by the library to which new
22FORMS objects are added, all functions that add a FORMS object to a
Guido van Rossum470be141995-03-17 16:07:09 +000023form are methods of the Python object representing the form.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000024Consequently, there are no Python equivalents for the C functions
Fred Drake0cf0cfb1998-02-19 20:59:19 +000025\cfunction{fl_addto_form()} and \cfunction{fl_end_form()}, and the
26equivalent of \cfunction{fl_bgn_form()} is called
27\function{fl.make_form()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000028
29Watch out for the somewhat confusing terminology: FORMS uses the word
30\dfn{object} for the buttons, sliders etc. that you can place in a form.
31In Python, `object' means any value. The Python interface to FORMS
32introduces two new Python object types: form objects (representing an
33entire form) and FORMS objects (representing one button, slider etc.).
Fred Drake0cf0cfb1998-02-19 20:59:19 +000034Hopefully this isn't too confusing.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000035
36There are no `free objects' in the Python interface to FORMS, nor is
37there an easy way to add object classes written in Python. The FORMS
Guido van Rossum470be141995-03-17 16:07:09 +000038interface to GL event handling is available, though, so you can mix
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000039FORMS with pure GL windows.
40
Fred Drake0cf0cfb1998-02-19 20:59:19 +000041\strong{Please note:} importing \module{fl} implies a call to the GL
42function \cfunction{foreground()} and to the FORMS routine
43\cfunction{fl_init()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000044
Fred Drakefc576191998-04-04 07:15:02 +000045\subsection{Functions Defined in Module \module{fl}}
Guido van Rossum86cb0921995-03-20 12:59:56 +000046\nodename{FL Functions}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000047
Fred Drake0cf0cfb1998-02-19 20:59:19 +000048Module \module{fl} defines the following functions. For more
49information about what they do, see the description of the equivalent
Fred Drakef6863c11999-03-02 16:37:17 +000050C function in the FORMS documentation:
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000051
Fred Drake5f874d61998-03-15 01:59:57 +000052\begin{funcdesc}{make_form}{type, width, height}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000053Create a form with given type, width and height. This returns a
54\dfn{form} object, whose methods are described below.
55\end{funcdesc}
56
57\begin{funcdesc}{do_forms}{}
58The standard FORMS main loop. Returns a Python object representing
59the FORMS object needing interaction, or the special value
Fred Drake0cf0cfb1998-02-19 20:59:19 +000060\constant{FL.EVENT}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000061\end{funcdesc}
62
63\begin{funcdesc}{check_forms}{}
Fred Drake0cf0cfb1998-02-19 20:59:19 +000064Check for FORMS events. Returns what \function{do_forms()} above
65returns, or \code{None} if there is no event that immediately needs
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000066interaction.
67\end{funcdesc}
68
69\begin{funcdesc}{set_event_call_back}{function}
70Set the event callback function.
71\end{funcdesc}
72
Fred Drake5f874d61998-03-15 01:59:57 +000073\begin{funcdesc}{set_graphics_mode}{rgbmode, doublebuffering}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000074Set the graphics modes.
75\end{funcdesc}
76
77\begin{funcdesc}{get_rgbmode}{}
Fred Drakef6863c11999-03-02 16:37:17 +000078Return the current rgb mode. This is the value of the C global
Fred Drake0cf0cfb1998-02-19 20:59:19 +000079variable \cdata{fl_rgbmode}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000080\end{funcdesc}
81
Fred Drake5f874d61998-03-15 01:59:57 +000082\begin{funcdesc}{show_message}{str1, str2, str3}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000083Show a dialog box with a three-line message and an OK button.
84\end{funcdesc}
85
Fred Drake5f874d61998-03-15 01:59:57 +000086\begin{funcdesc}{show_question}{str1, str2, str3}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000087Show a dialog box with a three-line message and YES and NO buttons.
88It returns \code{1} if the user pressed YES, \code{0} if NO.
89\end{funcdesc}
90
Fred Drakefc576191998-04-04 07:15:02 +000091\begin{funcdesc}{show_choice}{str1, str2, str3, but1\optional{,
92 but2\optional{, but3}}}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000093Show a dialog box with a three-line message and up to three buttons.
94It returns the number of the button clicked by the user
95(\code{1}, \code{2} or \code{3}).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000096\end{funcdesc}
97
Fred Drake5f874d61998-03-15 01:59:57 +000098\begin{funcdesc}{show_input}{prompt, default}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000099Show a dialog box with a one-line prompt message and text field in
100which the user can enter a string. The second argument is the default
101input string. It returns the string value as edited by the user.
102\end{funcdesc}
103
Fred Drake5f874d61998-03-15 01:59:57 +0000104\begin{funcdesc}{show_file_selector}{message, directory, pattern, default}
Guido van Rossum470be141995-03-17 16:07:09 +0000105Show a dialog box in which the user can select a file. It returns
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000106the absolute filename selected by the user, or \code{None} if the user
107presses Cancel.
108\end{funcdesc}
109
110\begin{funcdesc}{get_directory}{}
111\funcline{get_pattern}{}
112\funcline{get_filename}{}
113These functions return the directory, pattern and filename (the tail
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000114part only) selected by the user in the last
115\function{show_file_selector()} call.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000116\end{funcdesc}
117
118\begin{funcdesc}{qdevice}{dev}
119\funcline{unqdevice}{dev}
120\funcline{isqueued}{dev}
121\funcline{qtest}{}
122\funcline{qread}{}
123%\funcline{blkqread}{?}
124\funcline{qreset}{}
Fred Drake5f874d61998-03-15 01:59:57 +0000125\funcline{qenter}{dev, val}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000126\funcline{get_mouse}{}
Fred Drake5f874d61998-03-15 01:59:57 +0000127\funcline{tie}{button, valuator1, valuator2}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000128These functions are the FORMS interfaces to the corresponding GL
129functions. Use these if you want to handle some GL events yourself
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000130when using \function{fl.do_events()}. When a GL event is detected that
131FORMS cannot handle, \function{fl.do_forms()} returns the special value
132\constant{FL.EVENT} and you should call \function{fl.qread()} to read
133the event from the queue. Don't use the equivalent GL functions!
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000134\end{funcdesc}
135
136\begin{funcdesc}{color}{}
137\funcline{mapcolor}{}
138\funcline{getmcolor}{}
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000139See the description in the FORMS documentation of
140\cfunction{fl_color()}, \cfunction{fl_mapcolor()} and
141\cfunction{fl_getmcolor()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000142\end{funcdesc}
143
Guido van Rossum470be141995-03-17 16:07:09 +0000144\subsection{Form Objects}
Fred Drakefc576191998-04-04 07:15:02 +0000145\label{form-objects}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000146
Fred Drakefc576191998-04-04 07:15:02 +0000147Form objects (returned by \function{make_form()} above) have the
Fred Drakef6863c11999-03-02 16:37:17 +0000148following methods. Each method corresponds to a C function whose
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000149name is prefixed with \samp{fl_}; and whose first argument is a form
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000150pointer; please refer to the official FORMS documentation for
151descriptions.
152
Fred Drakefc576191998-04-04 07:15:02 +0000153All the \method{add_*()} methods return a Python object representing
154the FORMS object. Methods of FORMS objects are described below. Most
155kinds of FORMS object also have some methods specific to that kind;
156these methods are listed here.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000157
158\begin{flushleft}
Fred Drakefc576191998-04-04 07:15:02 +0000159
160\begin{methoddesc}[form]{show_form}{placement, bordertype, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000161 Show the form.
Fred Drakefc576191998-04-04 07:15:02 +0000162\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000163
Fred Drakefc576191998-04-04 07:15:02 +0000164\begin{methoddesc}[form]{hide_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000165 Hide the form.
Fred Drakefc576191998-04-04 07:15:02 +0000166\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000167
Fred Drakefc576191998-04-04 07:15:02 +0000168\begin{methoddesc}[form]{redraw_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000169 Redraw the form.
Fred Drakefc576191998-04-04 07:15:02 +0000170\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000171
Fred Drakefc576191998-04-04 07:15:02 +0000172\begin{methoddesc}[form]{set_form_position}{x, y}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000173Set the form's position.
Fred Drakefc576191998-04-04 07:15:02 +0000174\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000175
Fred Drakefc576191998-04-04 07:15:02 +0000176\begin{methoddesc}[form]{freeze_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000177Freeze the form.
Fred Drakefc576191998-04-04 07:15:02 +0000178\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000179
Fred Drakefc576191998-04-04 07:15:02 +0000180\begin{methoddesc}[form]{unfreeze_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000181 Unfreeze the form.
Fred Drakefc576191998-04-04 07:15:02 +0000182\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000183
Fred Drakefc576191998-04-04 07:15:02 +0000184\begin{methoddesc}[form]{activate_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000185 Activate the form.
Fred Drakefc576191998-04-04 07:15:02 +0000186\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000187
Fred Drakefc576191998-04-04 07:15:02 +0000188\begin{methoddesc}[form]{deactivate_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000189 Deactivate the form.
Fred Drakefc576191998-04-04 07:15:02 +0000190\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000191
Fred Drakefc576191998-04-04 07:15:02 +0000192\begin{methoddesc}[form]{bgn_group}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000193 Begin a new group of objects; return a group object.
Fred Drakefc576191998-04-04 07:15:02 +0000194\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000195
Fred Drakefc576191998-04-04 07:15:02 +0000196\begin{methoddesc}[form]{end_group}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000197 End the current group of objects.
Fred Drakefc576191998-04-04 07:15:02 +0000198\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000199
Fred Drakefc576191998-04-04 07:15:02 +0000200\begin{methoddesc}[form]{find_first}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000201 Find the first object in the form.
Fred Drakefc576191998-04-04 07:15:02 +0000202\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000203
Fred Drakefc576191998-04-04 07:15:02 +0000204\begin{methoddesc}[form]{find_last}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000205 Find the last object in the form.
Fred Drakefc576191998-04-04 07:15:02 +0000206\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000207
208%---
209
Fred Drakefc576191998-04-04 07:15:02 +0000210\begin{methoddesc}[form]{add_box}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000211Add a box object to the form.
212No extra methods.
Fred Drakefc576191998-04-04 07:15:02 +0000213\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000214
Fred Drakefc576191998-04-04 07:15:02 +0000215\begin{methoddesc}[form]{add_text}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000216Add a text object to the form.
217No extra methods.
Fred Drakefc576191998-04-04 07:15:02 +0000218\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000219
Fred Drakefc576191998-04-04 07:15:02 +0000220%\begin{methoddesc}[form]{add_bitmap}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000221%Add a bitmap object to the form.
Fred Drakefc576191998-04-04 07:15:02 +0000222%\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000223
Fred Drakefc576191998-04-04 07:15:02 +0000224\begin{methoddesc}[form]{add_clock}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000225Add a clock object to the form. \\
226Method:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000227\method{get_clock()}.
Fred Drakefc576191998-04-04 07:15:02 +0000228\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000229
230%---
231
Fred Drakefc576191998-04-04 07:15:02 +0000232\begin{methoddesc}[form]{add_button}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000233Add a button object to the form. \\
234Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000235\method{get_button()},
236\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000237\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000238
Fred Drakefc576191998-04-04 07:15:02 +0000239\begin{methoddesc}[form]{add_lightbutton}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000240Add a lightbutton object to the form. \\
241Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000242\method{get_button()},
243\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000244\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000245
Fred Drakefc576191998-04-04 07:15:02 +0000246\begin{methoddesc}[form]{add_roundbutton}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000247Add a roundbutton object to the form. \\
248Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000249\method{get_button()},
250\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000251\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000252
253%---
254
Fred Drakefc576191998-04-04 07:15:02 +0000255\begin{methoddesc}[form]{add_slider}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000256Add a slider object to the form. \\
257Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000258\method{set_slider_value()},
259\method{get_slider_value()},
260\method{set_slider_bounds()},
261\method{get_slider_bounds()},
262\method{set_slider_return()},
263\method{set_slider_size()},
264\method{set_slider_precision()},
265\method{set_slider_step()}.
Fred Drakefc576191998-04-04 07:15:02 +0000266\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000267
Fred Drakefc576191998-04-04 07:15:02 +0000268\begin{methoddesc}[form]{add_valslider}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000269Add a valslider object to the form. \\
270Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000271\method{set_slider_value()},
272\method{get_slider_value()},
273\method{set_slider_bounds()},
274\method{get_slider_bounds()},
275\method{set_slider_return()},
276\method{set_slider_size()},
277\method{set_slider_precision()},
278\method{set_slider_step()}.
Fred Drakefc576191998-04-04 07:15:02 +0000279\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000280
Fred Drakefc576191998-04-04 07:15:02 +0000281\begin{methoddesc}[form]{add_dial}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000282Add a dial object to the form. \\
283Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000284\method{set_dial_value()},
285\method{get_dial_value()},
286\method{set_dial_bounds()},
287\method{get_dial_bounds()}.
Fred Drakefc576191998-04-04 07:15:02 +0000288\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000289
Fred Drakefc576191998-04-04 07:15:02 +0000290\begin{methoddesc}[form]{add_positioner}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000291Add a positioner object to the form. \\
292Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000293\method{set_positioner_xvalue()},
294\method{set_positioner_yvalue()},
295\method{set_positioner_xbounds()},
296\method{set_positioner_ybounds()},
297\method{get_positioner_xvalue()},
298\method{get_positioner_yvalue()},
299\method{get_positioner_xbounds()},
300\method{get_positioner_ybounds()}.
Fred Drakefc576191998-04-04 07:15:02 +0000301\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000302
Fred Drakefc576191998-04-04 07:15:02 +0000303\begin{methoddesc}[form]{add_counter}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000304Add a counter object to the form. \\
305Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000306\method{set_counter_value()},
307\method{get_counter_value()},
308\method{set_counter_bounds()},
309\method{set_counter_step()},
310\method{set_counter_precision()},
311\method{set_counter_return()}.
Fred Drakefc576191998-04-04 07:15:02 +0000312\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000313
314%---
315
Fred Drakefc576191998-04-04 07:15:02 +0000316\begin{methoddesc}[form]{add_input}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000317Add a input object to the form. \\
318Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000319\method{set_input()},
320\method{get_input()},
321\method{set_input_color()},
322\method{set_input_return()}.
Fred Drakefc576191998-04-04 07:15:02 +0000323\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000324
325%---
326
Fred Drakefc576191998-04-04 07:15:02 +0000327\begin{methoddesc}[form]{add_menu}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000328Add a menu object to the form. \\
329Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000330\method{set_menu()},
331\method{get_menu()},
332\method{addto_menu()}.
Fred Drakefc576191998-04-04 07:15:02 +0000333\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000334
Fred Drakefc576191998-04-04 07:15:02 +0000335\begin{methoddesc}[form]{add_choice}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000336Add a choice object to the form. \\
337Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000338\method{set_choice()},
339\method{get_choice()},
340\method{clear_choice()},
341\method{addto_choice()},
342\method{replace_choice()},
343\method{delete_choice()},
344\method{get_choice_text()},
345\method{set_choice_fontsize()},
346\method{set_choice_fontstyle()}.
Fred Drakefc576191998-04-04 07:15:02 +0000347\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000348
Fred Drakefc576191998-04-04 07:15:02 +0000349\begin{methoddesc}[form]{add_browser}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000350Add a browser object to the form. \\
351Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000352\method{set_browser_topline()},
353\method{clear_browser()},
354\method{add_browser_line()},
355\method{addto_browser()},
356\method{insert_browser_line()},
357\method{delete_browser_line()},
358\method{replace_browser_line()},
359\method{get_browser_line()},
360\method{load_browser()},
361\method{get_browser_maxline()},
362\method{select_browser_line()},
363\method{deselect_browser_line()},
364\method{deselect_browser()},
365\method{isselected_browser_line()},
366\method{get_browser()},
367\method{set_browser_fontsize()},
368\method{set_browser_fontstyle()},
369\method{set_browser_specialkey()}.
Fred Drakefc576191998-04-04 07:15:02 +0000370\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000371
372%---
373
Fred Drakefc576191998-04-04 07:15:02 +0000374\begin{methoddesc}[form]{add_timer}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000375Add a timer object to the form. \\
376Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000377\method{set_timer()},
378\method{get_timer()}.
Fred Drakefc576191998-04-04 07:15:02 +0000379\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000380\end{flushleft}
381
382Form objects have the following data attributes; see the FORMS
383documentation:
384
Fred Drakeee601911998-04-11 20:53:03 +0000385\begin{tableiii}{l|l|l}{member}{Name}{C Type}{Meaning}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000386 \lineiii{window}{int (read-only)}{GL window id}
387 \lineiii{w}{float}{form width}
388 \lineiii{h}{float}{form height}
389 \lineiii{x}{float}{form x origin}
390 \lineiii{y}{float}{form y origin}
391 \lineiii{deactivated}{int}{nonzero if form is deactivated}
392 \lineiii{visible}{int}{nonzero if form is visible}
393 \lineiii{frozen}{int}{nonzero if form is frozen}
394 \lineiii{doublebuf}{int}{nonzero if double buffering on}
395\end{tableiii}
396
Guido van Rossum470be141995-03-17 16:07:09 +0000397\subsection{FORMS Objects}
Fred Drakefc576191998-04-04 07:15:02 +0000398\label{forms-objects}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000399
400Besides methods specific to particular kinds of FORMS objects, all
401FORMS objects also have the following methods:
402
Fred Drakefc576191998-04-04 07:15:02 +0000403\begin{methoddesc}[FORMS object]{set_call_back}{function, argument}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000404Set the object's callback function and argument. When the object
405needs interaction, the callback function will be called with two
406arguments: the object, and the callback argument. (FORMS objects
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000407without a callback function are returned by \function{fl.do_forms()}
408or \function{fl.check_forms()} when they need interaction.) Call this
409method without arguments to remove the callback function.
Fred Drakefc576191998-04-04 07:15:02 +0000410\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000411
Fred Drakefc576191998-04-04 07:15:02 +0000412\begin{methoddesc}[FORMS object]{delete_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000413 Delete the object.
Fred Drakefc576191998-04-04 07:15:02 +0000414\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000415
Fred Drakefc576191998-04-04 07:15:02 +0000416\begin{methoddesc}[FORMS object]{show_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000417 Show the object.
Fred Drakefc576191998-04-04 07:15:02 +0000418\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000419
Fred Drakefc576191998-04-04 07:15:02 +0000420\begin{methoddesc}[FORMS object]{hide_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000421 Hide the object.
Fred Drakefc576191998-04-04 07:15:02 +0000422\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000423
Fred Drakefc576191998-04-04 07:15:02 +0000424\begin{methoddesc}[FORMS object]{redraw_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000425 Redraw the object.
Fred Drakefc576191998-04-04 07:15:02 +0000426\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000427
Fred Drakefc576191998-04-04 07:15:02 +0000428\begin{methoddesc}[FORMS object]{freeze_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000429 Freeze the object.
Fred Drakefc576191998-04-04 07:15:02 +0000430\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000431
Fred Drakefc576191998-04-04 07:15:02 +0000432\begin{methoddesc}[FORMS object]{unfreeze_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000433 Unfreeze the object.
Fred Drakefc576191998-04-04 07:15:02 +0000434\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000435
Fred Drakefc576191998-04-04 07:15:02 +0000436%\begin{methoddesc}[FORMS object]{handle_object}{} XXX
437%\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000438
Fred Drakefc576191998-04-04 07:15:02 +0000439%\begin{methoddesc}[FORMS object]{handle_object_direct}{} XXX
440%\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000441
442FORMS objects have these data attributes; see the FORMS documentation:
443
Fred Drakeee601911998-04-11 20:53:03 +0000444\begin{tableiii}{l|l|l}{member}{Name}{C Type}{Meaning}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000445 \lineiii{objclass}{int (read-only)}{object class}
446 \lineiii{type}{int (read-only)}{object type}
447 \lineiii{boxtype}{int}{box type}
448 \lineiii{x}{float}{x origin}
449 \lineiii{y}{float}{y origin}
450 \lineiii{w}{float}{width}
451 \lineiii{h}{float}{height}
452 \lineiii{col1}{int}{primary color}
453 \lineiii{col2}{int}{secondary color}
454 \lineiii{align}{int}{alignment}
455 \lineiii{lcol}{int}{label color}
456 \lineiii{lsize}{float}{label font size}
457 \lineiii{label}{string}{label string}
458 \lineiii{lstyle}{int}{label style}
459 \lineiii{pushed}{int (read-only)}{(see FORMS docs)}
460 \lineiii{focus}{int (read-only)}{(see FORMS docs)}
461 \lineiii{belowmouse}{int (read-only)}{(see FORMS docs)}
462 \lineiii{frozen}{int (read-only)}{(see FORMS docs)}
463 \lineiii{active}{int (read-only)}{(see FORMS docs)}
464 \lineiii{input}{int (read-only)}{(see FORMS docs)}
465 \lineiii{visible}{int (read-only)}{(see FORMS docs)}
466 \lineiii{radio}{int (read-only)}{(see FORMS docs)}
467 \lineiii{automatic}{int (read-only)}{(see FORMS docs)}
468\end{tableiii}
469
Fred Drakeb91e9341998-07-23 17:59:49 +0000470
Fred Drakef6863c11999-03-02 16:37:17 +0000471\section{\module{FL} ---
472 Constants used with the \module{fl} module}
473
Fred Drake93503ca1999-03-12 16:24:22 +0000474\declaremodule[fl-constants]{standard}{FL}
Fred Drakef6863c11999-03-02 16:37:17 +0000475 \platform{IRIX}
Fred Drakeb91e9341998-07-23 17:59:49 +0000476\modulesynopsis{Constants used with the \module{fl} module.}
477
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000478
479This module defines symbolic constants needed to use the built-in
Fred Drakef6863c11999-03-02 16:37:17 +0000480module \refmodule{fl} (see above); they are equivalent to those defined in
481the C header file \code{<forms.h>} except that the name prefix
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000482\samp{FL_} is omitted. Read the module source for a complete list of
483the defined names. Suggested use:
484
Fred Drake19479911998-02-13 06:58:54 +0000485\begin{verbatim}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000486import fl
487from FL import *
Fred Drake19479911998-02-13 06:58:54 +0000488\end{verbatim}
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000489
Fred Drakeb91e9341998-07-23 17:59:49 +0000490
Fred Drakef6863c11999-03-02 16:37:17 +0000491\section{\module{flp} ---
492 Functions for loading stored FORMS designs}
493
494\declaremodule{standard}{flp}
495 \platform{IRIX}
496\modulesynopsis{Functions for loading stored FORMS designs.}
Fred Drakeb91e9341998-07-23 17:59:49 +0000497
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000498
499This module defines functions that can read form definitions created
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000500by the `form designer' (\program{fdesign}) program that comes with the
Fred Drakef6863c11999-03-02 16:37:17 +0000501FORMS library (see module \refmodule{fl} above).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000502
503For now, see the file \file{flp.doc} in the Python library source
504directory for a description.
505
506XXX A complete description should be inserted here!