blob: bafb8e49b9c412439a802e79f506275ed5252539 [file] [log] [blame]
Fred Drake295da241998-08-10 19:42:37 +00001\section{\module{fl} ---
Fred Drake8ee679f2001-07-14 02:50:55 +00002 FORMS library for graphical user interfaces}
Fred Drakeb91e9341998-07-23 17:59:49 +00003
Fred Drakef6863c11999-03-02 16:37:17 +00004\declaremodule{builtin}{fl}
5 \platform{IRIX}
Fred Drake8ee679f2001-07-14 02:50:55 +00006\modulesynopsis{FORMS library for applications with graphical user
7 interfaces.}
Fred Drakeb91e9341998-07-23 17:59:49 +00008
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00009
Fred Drake5f874d61998-03-15 01:59:57 +000010This module provides an interface to the FORMS Library\index{FORMS
11Library} by Mark Overmars\index{Overmars, Mark}. The source for the
12library can be retrieved by anonymous ftp from host
13\samp{ftp.cs.ruu.nl}, directory \file{SGI/FORMS}. It was last tested
14with version 2.0b.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000015
Fred Drakef6863c11999-03-02 16:37:17 +000016Most functions are literal translations of their C equivalents,
Guido van Rossum470be141995-03-17 16:07:09 +000017dropping the initial \samp{fl_} from their name. Constants used by
Fred Drake673c65e1999-04-29 18:42:18 +000018the library are defined in module \refmodule[fl-constants]{FL}
19described below.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000020
21The creation of objects is a little different in Python than in C:
22instead of the `current form' maintained by the library to which new
23FORMS objects are added, all functions that add a FORMS object to a
Guido van Rossum470be141995-03-17 16:07:09 +000024form are methods of the Python object representing the form.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000025Consequently, there are no Python equivalents for the C functions
Fred Drake0cf0cfb1998-02-19 20:59:19 +000026\cfunction{fl_addto_form()} and \cfunction{fl_end_form()}, and the
27equivalent of \cfunction{fl_bgn_form()} is called
28\function{fl.make_form()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000029
30Watch out for the somewhat confusing terminology: FORMS uses the word
31\dfn{object} for the buttons, sliders etc. that you can place in a form.
32In Python, `object' means any value. The Python interface to FORMS
33introduces two new Python object types: form objects (representing an
34entire form) and FORMS objects (representing one button, slider etc.).
Fred Drake0cf0cfb1998-02-19 20:59:19 +000035Hopefully this isn't too confusing.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000036
37There are no `free objects' in the Python interface to FORMS, nor is
38there an easy way to add object classes written in Python. The FORMS
Guido van Rossum470be141995-03-17 16:07:09 +000039interface to GL event handling is available, though, so you can mix
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000040FORMS with pure GL windows.
41
Fred Drake0cf0cfb1998-02-19 20:59:19 +000042\strong{Please note:} importing \module{fl} implies a call to the GL
43function \cfunction{foreground()} and to the FORMS routine
44\cfunction{fl_init()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000045
Fred Drakefc576191998-04-04 07:15:02 +000046\subsection{Functions Defined in Module \module{fl}}
Guido van Rossum86cb0921995-03-20 12:59:56 +000047\nodename{FL Functions}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000048
Fred Drake0cf0cfb1998-02-19 20:59:19 +000049Module \module{fl} defines the following functions. For more
50information about what they do, see the description of the equivalent
Fred Drakef6863c11999-03-02 16:37:17 +000051C function in the FORMS documentation:
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000052
Fred Drake5f874d61998-03-15 01:59:57 +000053\begin{funcdesc}{make_form}{type, width, height}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000054Create a form with given type, width and height. This returns a
55\dfn{form} object, whose methods are described below.
56\end{funcdesc}
57
58\begin{funcdesc}{do_forms}{}
59The standard FORMS main loop. Returns a Python object representing
60the FORMS object needing interaction, or the special value
Fred Drake0cf0cfb1998-02-19 20:59:19 +000061\constant{FL.EVENT}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000062\end{funcdesc}
63
64\begin{funcdesc}{check_forms}{}
Fred Drake0cf0cfb1998-02-19 20:59:19 +000065Check for FORMS events. Returns what \function{do_forms()} above
66returns, or \code{None} if there is no event that immediately needs
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000067interaction.
68\end{funcdesc}
69
70\begin{funcdesc}{set_event_call_back}{function}
71Set the event callback function.
72\end{funcdesc}
73
Fred Drake5f874d61998-03-15 01:59:57 +000074\begin{funcdesc}{set_graphics_mode}{rgbmode, doublebuffering}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000075Set the graphics modes.
76\end{funcdesc}
77
78\begin{funcdesc}{get_rgbmode}{}
Fred Drakef6863c11999-03-02 16:37:17 +000079Return the current rgb mode. This is the value of the C global
Fred Drake0cf0cfb1998-02-19 20:59:19 +000080variable \cdata{fl_rgbmode}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000081\end{funcdesc}
82
Fred Drake5f874d61998-03-15 01:59:57 +000083\begin{funcdesc}{show_message}{str1, str2, str3}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000084Show a dialog box with a three-line message and an OK button.
85\end{funcdesc}
86
Fred Drake5f874d61998-03-15 01:59:57 +000087\begin{funcdesc}{show_question}{str1, str2, str3}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000088Show a dialog box with a three-line message and YES and NO buttons.
89It returns \code{1} if the user pressed YES, \code{0} if NO.
90\end{funcdesc}
91
Fred Drakefc576191998-04-04 07:15:02 +000092\begin{funcdesc}{show_choice}{str1, str2, str3, but1\optional{,
93 but2\optional{, but3}}}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000094Show a dialog box with a three-line message and up to three buttons.
95It returns the number of the button clicked by the user
96(\code{1}, \code{2} or \code{3}).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000097\end{funcdesc}
98
Fred Drake5f874d61998-03-15 01:59:57 +000099\begin{funcdesc}{show_input}{prompt, default}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000100Show a dialog box with a one-line prompt message and text field in
101which the user can enter a string. The second argument is the default
102input string. It returns the string value as edited by the user.
103\end{funcdesc}
104
Fred Drake5f874d61998-03-15 01:59:57 +0000105\begin{funcdesc}{show_file_selector}{message, directory, pattern, default}
Guido van Rossum470be141995-03-17 16:07:09 +0000106Show a dialog box in which the user can select a file. It returns
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000107the absolute filename selected by the user, or \code{None} if the user
108presses Cancel.
109\end{funcdesc}
110
111\begin{funcdesc}{get_directory}{}
112\funcline{get_pattern}{}
113\funcline{get_filename}{}
114These functions return the directory, pattern and filename (the tail
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000115part only) selected by the user in the last
116\function{show_file_selector()} call.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000117\end{funcdesc}
118
119\begin{funcdesc}{qdevice}{dev}
120\funcline{unqdevice}{dev}
121\funcline{isqueued}{dev}
122\funcline{qtest}{}
123\funcline{qread}{}
124%\funcline{blkqread}{?}
125\funcline{qreset}{}
Fred Drake5f874d61998-03-15 01:59:57 +0000126\funcline{qenter}{dev, val}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000127\funcline{get_mouse}{}
Fred Drake5f874d61998-03-15 01:59:57 +0000128\funcline{tie}{button, valuator1, valuator2}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000129These functions are the FORMS interfaces to the corresponding GL
130functions. Use these if you want to handle some GL events yourself
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000131when using \function{fl.do_events()}. When a GL event is detected that
132FORMS cannot handle, \function{fl.do_forms()} returns the special value
133\constant{FL.EVENT} and you should call \function{fl.qread()} to read
134the event from the queue. Don't use the equivalent GL functions!
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000135\end{funcdesc}
136
137\begin{funcdesc}{color}{}
138\funcline{mapcolor}{}
139\funcline{getmcolor}{}
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000140See the description in the FORMS documentation of
141\cfunction{fl_color()}, \cfunction{fl_mapcolor()} and
142\cfunction{fl_getmcolor()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000143\end{funcdesc}
144
Guido van Rossum470be141995-03-17 16:07:09 +0000145\subsection{Form Objects}
Fred Drakefc576191998-04-04 07:15:02 +0000146\label{form-objects}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000147
Fred Drakefc576191998-04-04 07:15:02 +0000148Form objects (returned by \function{make_form()} above) have the
Fred Drakef6863c11999-03-02 16:37:17 +0000149following methods. Each method corresponds to a C function whose
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000150name is prefixed with \samp{fl_}; and whose first argument is a form
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000151pointer; please refer to the official FORMS documentation for
152descriptions.
153
Fred Drakefc576191998-04-04 07:15:02 +0000154All the \method{add_*()} methods return a Python object representing
155the FORMS object. Methods of FORMS objects are described below. Most
156kinds of FORMS object also have some methods specific to that kind;
157these methods are listed here.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000158
159\begin{flushleft}
Fred Drakefc576191998-04-04 07:15:02 +0000160
161\begin{methoddesc}[form]{show_form}{placement, bordertype, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000162 Show the form.
Fred Drakefc576191998-04-04 07:15:02 +0000163\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000164
Fred Drakefc576191998-04-04 07:15:02 +0000165\begin{methoddesc}[form]{hide_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000166 Hide the form.
Fred Drakefc576191998-04-04 07:15:02 +0000167\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000168
Fred Drakefc576191998-04-04 07:15:02 +0000169\begin{methoddesc}[form]{redraw_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000170 Redraw the form.
Fred Drakefc576191998-04-04 07:15:02 +0000171\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000172
Fred Drakefc576191998-04-04 07:15:02 +0000173\begin{methoddesc}[form]{set_form_position}{x, y}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000174Set the form's position.
Fred Drakefc576191998-04-04 07:15:02 +0000175\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000176
Fred Drakefc576191998-04-04 07:15:02 +0000177\begin{methoddesc}[form]{freeze_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000178Freeze the form.
Fred Drakefc576191998-04-04 07:15:02 +0000179\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000180
Fred Drakefc576191998-04-04 07:15:02 +0000181\begin{methoddesc}[form]{unfreeze_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000182 Unfreeze the form.
Fred Drakefc576191998-04-04 07:15:02 +0000183\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000184
Fred Drakefc576191998-04-04 07:15:02 +0000185\begin{methoddesc}[form]{activate_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000186 Activate the form.
Fred Drakefc576191998-04-04 07:15:02 +0000187\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000188
Fred Drakefc576191998-04-04 07:15:02 +0000189\begin{methoddesc}[form]{deactivate_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000190 Deactivate the form.
Fred Drakefc576191998-04-04 07:15:02 +0000191\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000192
Fred Drakefc576191998-04-04 07:15:02 +0000193\begin{methoddesc}[form]{bgn_group}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000194 Begin a new group of objects; return a group object.
Fred Drakefc576191998-04-04 07:15:02 +0000195\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000196
Fred Drakefc576191998-04-04 07:15:02 +0000197\begin{methoddesc}[form]{end_group}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000198 End the current group of objects.
Fred Drakefc576191998-04-04 07:15:02 +0000199\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000200
Fred Drakefc576191998-04-04 07:15:02 +0000201\begin{methoddesc}[form]{find_first}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000202 Find the first object in the form.
Fred Drakefc576191998-04-04 07:15:02 +0000203\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000204
Fred Drakefc576191998-04-04 07:15:02 +0000205\begin{methoddesc}[form]{find_last}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000206 Find the last object in the form.
Fred Drakefc576191998-04-04 07:15:02 +0000207\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000208
209%---
210
Fred Drakefc576191998-04-04 07:15:02 +0000211\begin{methoddesc}[form]{add_box}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000212Add a box object to the form.
213No extra methods.
Fred Drakefc576191998-04-04 07:15:02 +0000214\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000215
Fred Drakefc576191998-04-04 07:15:02 +0000216\begin{methoddesc}[form]{add_text}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000217Add a text object to the form.
218No extra methods.
Fred Drakefc576191998-04-04 07:15:02 +0000219\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000220
Fred Drakefc576191998-04-04 07:15:02 +0000221%\begin{methoddesc}[form]{add_bitmap}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000222%Add a bitmap object to the form.
Fred Drakefc576191998-04-04 07:15:02 +0000223%\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000224
Fred Drakefc576191998-04-04 07:15:02 +0000225\begin{methoddesc}[form]{add_clock}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000226Add a clock object to the form. \\
227Method:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000228\method{get_clock()}.
Fred Drakefc576191998-04-04 07:15:02 +0000229\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000230
231%---
232
Fred Drakefc576191998-04-04 07:15:02 +0000233\begin{methoddesc}[form]{add_button}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000234Add a button object to the form. \\
235Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000236\method{get_button()},
237\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000238\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000239
Fred Drakefc576191998-04-04 07:15:02 +0000240\begin{methoddesc}[form]{add_lightbutton}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000241Add a lightbutton object to the form. \\
242Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000243\method{get_button()},
244\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000245\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000246
Fred Drakefc576191998-04-04 07:15:02 +0000247\begin{methoddesc}[form]{add_roundbutton}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000248Add a roundbutton object to the form. \\
249Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000250\method{get_button()},
251\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000252\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000253
254%---
255
Fred Drakefc576191998-04-04 07:15:02 +0000256\begin{methoddesc}[form]{add_slider}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000257Add a slider object to the form. \\
258Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000259\method{set_slider_value()},
260\method{get_slider_value()},
261\method{set_slider_bounds()},
262\method{get_slider_bounds()},
263\method{set_slider_return()},
264\method{set_slider_size()},
265\method{set_slider_precision()},
266\method{set_slider_step()}.
Fred Drakefc576191998-04-04 07:15:02 +0000267\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000268
Fred Drakefc576191998-04-04 07:15:02 +0000269\begin{methoddesc}[form]{add_valslider}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000270Add a valslider object to the form. \\
271Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000272\method{set_slider_value()},
273\method{get_slider_value()},
274\method{set_slider_bounds()},
275\method{get_slider_bounds()},
276\method{set_slider_return()},
277\method{set_slider_size()},
278\method{set_slider_precision()},
279\method{set_slider_step()}.
Fred Drakefc576191998-04-04 07:15:02 +0000280\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000281
Fred Drakefc576191998-04-04 07:15:02 +0000282\begin{methoddesc}[form]{add_dial}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000283Add a dial object to the form. \\
284Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000285\method{set_dial_value()},
286\method{get_dial_value()},
287\method{set_dial_bounds()},
288\method{get_dial_bounds()}.
Fred Drakefc576191998-04-04 07:15:02 +0000289\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000290
Fred Drakefc576191998-04-04 07:15:02 +0000291\begin{methoddesc}[form]{add_positioner}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000292Add a positioner object to the form. \\
293Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000294\method{set_positioner_xvalue()},
295\method{set_positioner_yvalue()},
296\method{set_positioner_xbounds()},
297\method{set_positioner_ybounds()},
298\method{get_positioner_xvalue()},
299\method{get_positioner_yvalue()},
300\method{get_positioner_xbounds()},
301\method{get_positioner_ybounds()}.
Fred Drakefc576191998-04-04 07:15:02 +0000302\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000303
Fred Drakefc576191998-04-04 07:15:02 +0000304\begin{methoddesc}[form]{add_counter}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000305Add a counter object to the form. \\
306Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000307\method{set_counter_value()},
308\method{get_counter_value()},
309\method{set_counter_bounds()},
310\method{set_counter_step()},
311\method{set_counter_precision()},
312\method{set_counter_return()}.
Fred Drakefc576191998-04-04 07:15:02 +0000313\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000314
315%---
316
Fred Drakefc576191998-04-04 07:15:02 +0000317\begin{methoddesc}[form]{add_input}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000318Add a input object to the form. \\
319Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000320\method{set_input()},
321\method{get_input()},
322\method{set_input_color()},
323\method{set_input_return()}.
Fred Drakefc576191998-04-04 07:15:02 +0000324\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000325
326%---
327
Fred Drakefc576191998-04-04 07:15:02 +0000328\begin{methoddesc}[form]{add_menu}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000329Add a menu object to the form. \\
330Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000331\method{set_menu()},
332\method{get_menu()},
333\method{addto_menu()}.
Fred Drakefc576191998-04-04 07:15:02 +0000334\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000335
Fred Drakefc576191998-04-04 07:15:02 +0000336\begin{methoddesc}[form]{add_choice}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000337Add a choice object to the form. \\
338Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000339\method{set_choice()},
340\method{get_choice()},
341\method{clear_choice()},
342\method{addto_choice()},
343\method{replace_choice()},
344\method{delete_choice()},
345\method{get_choice_text()},
346\method{set_choice_fontsize()},
347\method{set_choice_fontstyle()}.
Fred Drakefc576191998-04-04 07:15:02 +0000348\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000349
Fred Drakefc576191998-04-04 07:15:02 +0000350\begin{methoddesc}[form]{add_browser}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000351Add a browser object to the form. \\
352Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000353\method{set_browser_topline()},
354\method{clear_browser()},
355\method{add_browser_line()},
356\method{addto_browser()},
357\method{insert_browser_line()},
358\method{delete_browser_line()},
359\method{replace_browser_line()},
360\method{get_browser_line()},
361\method{load_browser()},
362\method{get_browser_maxline()},
363\method{select_browser_line()},
364\method{deselect_browser_line()},
365\method{deselect_browser()},
366\method{isselected_browser_line()},
367\method{get_browser()},
368\method{set_browser_fontsize()},
369\method{set_browser_fontstyle()},
370\method{set_browser_specialkey()}.
Fred Drakefc576191998-04-04 07:15:02 +0000371\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000372
373%---
374
Fred Drakefc576191998-04-04 07:15:02 +0000375\begin{methoddesc}[form]{add_timer}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000376Add a timer object to the form. \\
377Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000378\method{set_timer()},
379\method{get_timer()}.
Fred Drakefc576191998-04-04 07:15:02 +0000380\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000381\end{flushleft}
382
383Form objects have the following data attributes; see the FORMS
384documentation:
385
Fred Drakeee601911998-04-11 20:53:03 +0000386\begin{tableiii}{l|l|l}{member}{Name}{C Type}{Meaning}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000387 \lineiii{window}{int (read-only)}{GL window id}
388 \lineiii{w}{float}{form width}
389 \lineiii{h}{float}{form height}
390 \lineiii{x}{float}{form x origin}
391 \lineiii{y}{float}{form y origin}
392 \lineiii{deactivated}{int}{nonzero if form is deactivated}
393 \lineiii{visible}{int}{nonzero if form is visible}
394 \lineiii{frozen}{int}{nonzero if form is frozen}
395 \lineiii{doublebuf}{int}{nonzero if double buffering on}
396\end{tableiii}
397
Guido van Rossum470be141995-03-17 16:07:09 +0000398\subsection{FORMS Objects}
Fred Drakefc576191998-04-04 07:15:02 +0000399\label{forms-objects}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000400
401Besides methods specific to particular kinds of FORMS objects, all
402FORMS objects also have the following methods:
403
Fred Drakefc576191998-04-04 07:15:02 +0000404\begin{methoddesc}[FORMS object]{set_call_back}{function, argument}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000405Set the object's callback function and argument. When the object
406needs interaction, the callback function will be called with two
407arguments: the object, and the callback argument. (FORMS objects
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000408without a callback function are returned by \function{fl.do_forms()}
409or \function{fl.check_forms()} when they need interaction.) Call this
410method without arguments to remove the callback function.
Fred Drakefc576191998-04-04 07:15:02 +0000411\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000412
Fred Drakefc576191998-04-04 07:15:02 +0000413\begin{methoddesc}[FORMS object]{delete_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000414 Delete the object.
Fred Drakefc576191998-04-04 07:15:02 +0000415\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000416
Fred Drakefc576191998-04-04 07:15:02 +0000417\begin{methoddesc}[FORMS object]{show_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000418 Show the object.
Fred Drakefc576191998-04-04 07:15:02 +0000419\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000420
Fred Drakefc576191998-04-04 07:15:02 +0000421\begin{methoddesc}[FORMS object]{hide_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000422 Hide the object.
Fred Drakefc576191998-04-04 07:15:02 +0000423\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000424
Fred Drakefc576191998-04-04 07:15:02 +0000425\begin{methoddesc}[FORMS object]{redraw_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000426 Redraw the object.
Fred Drakefc576191998-04-04 07:15:02 +0000427\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000428
Fred Drakefc576191998-04-04 07:15:02 +0000429\begin{methoddesc}[FORMS object]{freeze_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000430 Freeze the object.
Fred Drakefc576191998-04-04 07:15:02 +0000431\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000432
Fred Drakefc576191998-04-04 07:15:02 +0000433\begin{methoddesc}[FORMS object]{unfreeze_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000434 Unfreeze the object.
Fred Drakefc576191998-04-04 07:15:02 +0000435\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000436
Fred Drakefc576191998-04-04 07:15:02 +0000437%\begin{methoddesc}[FORMS object]{handle_object}{} XXX
438%\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000439
Fred Drakefc576191998-04-04 07:15:02 +0000440%\begin{methoddesc}[FORMS object]{handle_object_direct}{} XXX
441%\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000442
443FORMS objects have these data attributes; see the FORMS documentation:
444
Fred Drakeee601911998-04-11 20:53:03 +0000445\begin{tableiii}{l|l|l}{member}{Name}{C Type}{Meaning}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000446 \lineiii{objclass}{int (read-only)}{object class}
447 \lineiii{type}{int (read-only)}{object type}
448 \lineiii{boxtype}{int}{box type}
449 \lineiii{x}{float}{x origin}
450 \lineiii{y}{float}{y origin}
451 \lineiii{w}{float}{width}
452 \lineiii{h}{float}{height}
453 \lineiii{col1}{int}{primary color}
454 \lineiii{col2}{int}{secondary color}
455 \lineiii{align}{int}{alignment}
456 \lineiii{lcol}{int}{label color}
457 \lineiii{lsize}{float}{label font size}
458 \lineiii{label}{string}{label string}
459 \lineiii{lstyle}{int}{label style}
460 \lineiii{pushed}{int (read-only)}{(see FORMS docs)}
461 \lineiii{focus}{int (read-only)}{(see FORMS docs)}
462 \lineiii{belowmouse}{int (read-only)}{(see FORMS docs)}
463 \lineiii{frozen}{int (read-only)}{(see FORMS docs)}
464 \lineiii{active}{int (read-only)}{(see FORMS docs)}
465 \lineiii{input}{int (read-only)}{(see FORMS docs)}
466 \lineiii{visible}{int (read-only)}{(see FORMS docs)}
467 \lineiii{radio}{int (read-only)}{(see FORMS docs)}
468 \lineiii{automatic}{int (read-only)}{(see FORMS docs)}
469\end{tableiii}
470
Fred Drakeb91e9341998-07-23 17:59:49 +0000471
Fred Drakef6863c11999-03-02 16:37:17 +0000472\section{\module{FL} ---
473 Constants used with the \module{fl} module}
474
Fred Drake93503ca1999-03-12 16:24:22 +0000475\declaremodule[fl-constants]{standard}{FL}
Fred Drakef6863c11999-03-02 16:37:17 +0000476 \platform{IRIX}
Fred Drakeb91e9341998-07-23 17:59:49 +0000477\modulesynopsis{Constants used with the \module{fl} module.}
478
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000479
480This module defines symbolic constants needed to use the built-in
Fred Drakef6863c11999-03-02 16:37:17 +0000481module \refmodule{fl} (see above); they are equivalent to those defined in
482the C header file \code{<forms.h>} except that the name prefix
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000483\samp{FL_} is omitted. Read the module source for a complete list of
484the defined names. Suggested use:
485
Fred Drake19479911998-02-13 06:58:54 +0000486\begin{verbatim}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000487import fl
488from FL import *
Fred Drake19479911998-02-13 06:58:54 +0000489\end{verbatim}
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000490
Fred Drakeb91e9341998-07-23 17:59:49 +0000491
Fred Drakef6863c11999-03-02 16:37:17 +0000492\section{\module{flp} ---
493 Functions for loading stored FORMS designs}
494
495\declaremodule{standard}{flp}
496 \platform{IRIX}
497\modulesynopsis{Functions for loading stored FORMS designs.}
Fred Drakeb91e9341998-07-23 17:59:49 +0000498
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000499
500This module defines functions that can read form definitions created
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000501by the `form designer' (\program{fdesign}) program that comes with the
Fred Drakef6863c11999-03-02 16:37:17 +0000502FORMS library (see module \refmodule{fl} above).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000503
504For now, see the file \file{flp.doc} in the Python library source
505directory for a description.
506
507XXX A complete description should be inserted here!