blob: 601b2c8beaf16ca271b66963ec49996a09a54f40 [file] [log] [blame]
Fred Drakefc576191998-04-04 07:15:02 +00001\section{Built-in Module \module{fl}}
Fred Drakeb91e9341998-07-23 17:59:49 +00002\declaremodule{builtin}{fl}
3
4\modulesynopsis{FORMS library interface for GUI applications.}
5
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00006
Fred Drake5f874d61998-03-15 01:59:57 +00007This module provides an interface to the FORMS Library\index{FORMS
8Library} by Mark Overmars\index{Overmars, Mark}. The source for the
9library can be retrieved by anonymous ftp from host
10\samp{ftp.cs.ruu.nl}, directory \file{SGI/FORMS}. It was last tested
11with version 2.0b.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000012
Fred Drake0cf0cfb1998-02-19 20:59:19 +000013Most functions are literal translations of their \C{} equivalents,
Guido van Rossum470be141995-03-17 16:07:09 +000014dropping the initial \samp{fl_} from their name. Constants used by
Fred Drake0cf0cfb1998-02-19 20:59:19 +000015the library are defined in module \module{FL} described below.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000016
17The creation of objects is a little different in Python than in C:
18instead of the `current form' maintained by the library to which new
19FORMS objects are added, all functions that add a FORMS object to a
Guido van Rossum470be141995-03-17 16:07:09 +000020form are methods of the Python object representing the form.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000021Consequently, there are no Python equivalents for the C functions
Fred Drake0cf0cfb1998-02-19 20:59:19 +000022\cfunction{fl_addto_form()} and \cfunction{fl_end_form()}, and the
23equivalent of \cfunction{fl_bgn_form()} is called
24\function{fl.make_form()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000025
26Watch out for the somewhat confusing terminology: FORMS uses the word
27\dfn{object} for the buttons, sliders etc. that you can place in a form.
28In Python, `object' means any value. The Python interface to FORMS
29introduces two new Python object types: form objects (representing an
30entire form) and FORMS objects (representing one button, slider etc.).
Fred Drake0cf0cfb1998-02-19 20:59:19 +000031Hopefully this isn't too confusing.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000032
33There are no `free objects' in the Python interface to FORMS, nor is
34there an easy way to add object classes written in Python. The FORMS
Guido van Rossum470be141995-03-17 16:07:09 +000035interface to GL event handling is available, though, so you can mix
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000036FORMS with pure GL windows.
37
Fred Drake0cf0cfb1998-02-19 20:59:19 +000038\strong{Please note:} importing \module{fl} implies a call to the GL
39function \cfunction{foreground()} and to the FORMS routine
40\cfunction{fl_init()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000041
Fred Drakefc576191998-04-04 07:15:02 +000042\subsection{Functions Defined in Module \module{fl}}
Guido van Rossum86cb0921995-03-20 12:59:56 +000043\nodename{FL Functions}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000044
Fred Drake0cf0cfb1998-02-19 20:59:19 +000045Module \module{fl} defines the following functions. For more
46information about what they do, see the description of the equivalent
47\C{} function in the FORMS documentation:
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000048
Fred Drake5f874d61998-03-15 01:59:57 +000049\begin{funcdesc}{make_form}{type, width, height}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000050Create a form with given type, width and height. This returns a
51\dfn{form} object, whose methods are described below.
52\end{funcdesc}
53
54\begin{funcdesc}{do_forms}{}
55The standard FORMS main loop. Returns a Python object representing
56the FORMS object needing interaction, or the special value
Fred Drake0cf0cfb1998-02-19 20:59:19 +000057\constant{FL.EVENT}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000058\end{funcdesc}
59
60\begin{funcdesc}{check_forms}{}
Fred Drake0cf0cfb1998-02-19 20:59:19 +000061Check for FORMS events. Returns what \function{do_forms()} above
62returns, or \code{None} if there is no event that immediately needs
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000063interaction.
64\end{funcdesc}
65
66\begin{funcdesc}{set_event_call_back}{function}
67Set the event callback function.
68\end{funcdesc}
69
Fred Drake5f874d61998-03-15 01:59:57 +000070\begin{funcdesc}{set_graphics_mode}{rgbmode, doublebuffering}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000071Set the graphics modes.
72\end{funcdesc}
73
74\begin{funcdesc}{get_rgbmode}{}
Fred Drake5f874d61998-03-15 01:59:57 +000075Return the current rgb mode. This is the value of the \C{} global
Fred Drake0cf0cfb1998-02-19 20:59:19 +000076variable \cdata{fl_rgbmode}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000077\end{funcdesc}
78
Fred Drake5f874d61998-03-15 01:59:57 +000079\begin{funcdesc}{show_message}{str1, str2, str3}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000080Show a dialog box with a three-line message and an OK button.
81\end{funcdesc}
82
Fred Drake5f874d61998-03-15 01:59:57 +000083\begin{funcdesc}{show_question}{str1, str2, str3}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000084Show a dialog box with a three-line message and YES and NO buttons.
85It returns \code{1} if the user pressed YES, \code{0} if NO.
86\end{funcdesc}
87
Fred Drakefc576191998-04-04 07:15:02 +000088\begin{funcdesc}{show_choice}{str1, str2, str3, but1\optional{,
89 but2\optional{, but3}}}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000090Show a dialog box with a three-line message and up to three buttons.
91It returns the number of the button clicked by the user
92(\code{1}, \code{2} or \code{3}).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000093\end{funcdesc}
94
Fred Drake5f874d61998-03-15 01:59:57 +000095\begin{funcdesc}{show_input}{prompt, default}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000096Show a dialog box with a one-line prompt message and text field in
97which the user can enter a string. The second argument is the default
98input string. It returns the string value as edited by the user.
99\end{funcdesc}
100
Fred Drake5f874d61998-03-15 01:59:57 +0000101\begin{funcdesc}{show_file_selector}{message, directory, pattern, default}
Guido van Rossum470be141995-03-17 16:07:09 +0000102Show a dialog box in which the user can select a file. It returns
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000103the absolute filename selected by the user, or \code{None} if the user
104presses Cancel.
105\end{funcdesc}
106
107\begin{funcdesc}{get_directory}{}
108\funcline{get_pattern}{}
109\funcline{get_filename}{}
110These functions return the directory, pattern and filename (the tail
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000111part only) selected by the user in the last
112\function{show_file_selector()} call.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000113\end{funcdesc}
114
115\begin{funcdesc}{qdevice}{dev}
116\funcline{unqdevice}{dev}
117\funcline{isqueued}{dev}
118\funcline{qtest}{}
119\funcline{qread}{}
120%\funcline{blkqread}{?}
121\funcline{qreset}{}
Fred Drake5f874d61998-03-15 01:59:57 +0000122\funcline{qenter}{dev, val}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000123\funcline{get_mouse}{}
Fred Drake5f874d61998-03-15 01:59:57 +0000124\funcline{tie}{button, valuator1, valuator2}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000125These functions are the FORMS interfaces to the corresponding GL
126functions. Use these if you want to handle some GL events yourself
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000127when using \function{fl.do_events()}. When a GL event is detected that
128FORMS cannot handle, \function{fl.do_forms()} returns the special value
129\constant{FL.EVENT} and you should call \function{fl.qread()} to read
130the event from the queue. Don't use the equivalent GL functions!
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000131\end{funcdesc}
132
133\begin{funcdesc}{color}{}
134\funcline{mapcolor}{}
135\funcline{getmcolor}{}
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000136See the description in the FORMS documentation of
137\cfunction{fl_color()}, \cfunction{fl_mapcolor()} and
138\cfunction{fl_getmcolor()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000139\end{funcdesc}
140
Guido van Rossum470be141995-03-17 16:07:09 +0000141\subsection{Form Objects}
Fred Drakefc576191998-04-04 07:15:02 +0000142\label{form-objects}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000143
Fred Drakefc576191998-04-04 07:15:02 +0000144Form objects (returned by \function{make_form()} above) have the
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000145following methods. Each method corresponds to a \C{} function whose
146name is prefixed with \samp{fl_}; and whose first argument is a form
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000147pointer; please refer to the official FORMS documentation for
148descriptions.
149
Fred Drakefc576191998-04-04 07:15:02 +0000150All the \method{add_*()} methods return a Python object representing
151the FORMS object. Methods of FORMS objects are described below. Most
152kinds of FORMS object also have some methods specific to that kind;
153these methods are listed here.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000154
155\begin{flushleft}
Fred Drakefc576191998-04-04 07:15:02 +0000156
157\begin{methoddesc}[form]{show_form}{placement, bordertype, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000158 Show the form.
Fred Drakefc576191998-04-04 07:15:02 +0000159\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000160
Fred Drakefc576191998-04-04 07:15:02 +0000161\begin{methoddesc}[form]{hide_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000162 Hide 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]{redraw_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000166 Redraw 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]{set_form_position}{x, y}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000170Set the form's position.
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]{freeze_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000174Freeze the form.
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]{unfreeze_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000178 Unfreeze 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]{activate_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000182 Activate 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]{deactivate_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000186 Deactivate 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]{bgn_group}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000190 Begin a new group of objects; return a group object.
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]{end_group}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000194 End the current group of objects.
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]{find_first}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000198 Find the first object in the form.
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_last}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000202 Find the last object in the form.
Fred Drakefc576191998-04-04 07:15:02 +0000203\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000204
205%---
206
Fred Drakefc576191998-04-04 07:15:02 +0000207\begin{methoddesc}[form]{add_box}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000208Add a box object to the form.
209No extra methods.
Fred Drakefc576191998-04-04 07:15:02 +0000210\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000211
Fred Drakefc576191998-04-04 07:15:02 +0000212\begin{methoddesc}[form]{add_text}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000213Add a text object to the form.
214No extra methods.
Fred Drakefc576191998-04-04 07:15:02 +0000215\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000216
Fred Drakefc576191998-04-04 07:15:02 +0000217%\begin{methoddesc}[form]{add_bitmap}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000218%Add a bitmap object to the form.
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_clock}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000222Add a clock object to the form. \\
223Method:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000224\method{get_clock()}.
Fred Drakefc576191998-04-04 07:15:02 +0000225\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000226
227%---
228
Fred Drakefc576191998-04-04 07:15:02 +0000229\begin{methoddesc}[form]{add_button}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000230Add a button object to the form. \\
231Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000232\method{get_button()},
233\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000234\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000235
Fred Drakefc576191998-04-04 07:15:02 +0000236\begin{methoddesc}[form]{add_lightbutton}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000237Add a lightbutton object to the form. \\
238Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000239\method{get_button()},
240\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000241\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000242
Fred Drakefc576191998-04-04 07:15:02 +0000243\begin{methoddesc}[form]{add_roundbutton}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000244Add a roundbutton object to the form. \\
245Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000246\method{get_button()},
247\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000248\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000249
250%---
251
Fred Drakefc576191998-04-04 07:15:02 +0000252\begin{methoddesc}[form]{add_slider}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000253Add a slider object to the form. \\
254Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000255\method{set_slider_value()},
256\method{get_slider_value()},
257\method{set_slider_bounds()},
258\method{get_slider_bounds()},
259\method{set_slider_return()},
260\method{set_slider_size()},
261\method{set_slider_precision()},
262\method{set_slider_step()}.
Fred Drakefc576191998-04-04 07:15:02 +0000263\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000264
Fred Drakefc576191998-04-04 07:15:02 +0000265\begin{methoddesc}[form]{add_valslider}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000266Add a valslider object to the form. \\
267Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000268\method{set_slider_value()},
269\method{get_slider_value()},
270\method{set_slider_bounds()},
271\method{get_slider_bounds()},
272\method{set_slider_return()},
273\method{set_slider_size()},
274\method{set_slider_precision()},
275\method{set_slider_step()}.
Fred Drakefc576191998-04-04 07:15:02 +0000276\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000277
Fred Drakefc576191998-04-04 07:15:02 +0000278\begin{methoddesc}[form]{add_dial}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000279Add a dial object to the form. \\
280Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000281\method{set_dial_value()},
282\method{get_dial_value()},
283\method{set_dial_bounds()},
284\method{get_dial_bounds()}.
Fred Drakefc576191998-04-04 07:15:02 +0000285\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000286
Fred Drakefc576191998-04-04 07:15:02 +0000287\begin{methoddesc}[form]{add_positioner}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000288Add a positioner object to the form. \\
289Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000290\method{set_positioner_xvalue()},
291\method{set_positioner_yvalue()},
292\method{set_positioner_xbounds()},
293\method{set_positioner_ybounds()},
294\method{get_positioner_xvalue()},
295\method{get_positioner_yvalue()},
296\method{get_positioner_xbounds()},
297\method{get_positioner_ybounds()}.
Fred Drakefc576191998-04-04 07:15:02 +0000298\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000299
Fred Drakefc576191998-04-04 07:15:02 +0000300\begin{methoddesc}[form]{add_counter}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000301Add a counter object to the form. \\
302Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000303\method{set_counter_value()},
304\method{get_counter_value()},
305\method{set_counter_bounds()},
306\method{set_counter_step()},
307\method{set_counter_precision()},
308\method{set_counter_return()}.
Fred Drakefc576191998-04-04 07:15:02 +0000309\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000310
311%---
312
Fred Drakefc576191998-04-04 07:15:02 +0000313\begin{methoddesc}[form]{add_input}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000314Add a input object to the form. \\
315Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000316\method{set_input()},
317\method{get_input()},
318\method{set_input_color()},
319\method{set_input_return()}.
Fred Drakefc576191998-04-04 07:15:02 +0000320\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000321
322%---
323
Fred Drakefc576191998-04-04 07:15:02 +0000324\begin{methoddesc}[form]{add_menu}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000325Add a menu object to the form. \\
326Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000327\method{set_menu()},
328\method{get_menu()},
329\method{addto_menu()}.
Fred Drakefc576191998-04-04 07:15:02 +0000330\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000331
Fred Drakefc576191998-04-04 07:15:02 +0000332\begin{methoddesc}[form]{add_choice}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000333Add a choice object to the form. \\
334Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000335\method{set_choice()},
336\method{get_choice()},
337\method{clear_choice()},
338\method{addto_choice()},
339\method{replace_choice()},
340\method{delete_choice()},
341\method{get_choice_text()},
342\method{set_choice_fontsize()},
343\method{set_choice_fontstyle()}.
Fred Drakefc576191998-04-04 07:15:02 +0000344\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000345
Fred Drakefc576191998-04-04 07:15:02 +0000346\begin{methoddesc}[form]{add_browser}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000347Add a browser object to the form. \\
348Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000349\method{set_browser_topline()},
350\method{clear_browser()},
351\method{add_browser_line()},
352\method{addto_browser()},
353\method{insert_browser_line()},
354\method{delete_browser_line()},
355\method{replace_browser_line()},
356\method{get_browser_line()},
357\method{load_browser()},
358\method{get_browser_maxline()},
359\method{select_browser_line()},
360\method{deselect_browser_line()},
361\method{deselect_browser()},
362\method{isselected_browser_line()},
363\method{get_browser()},
364\method{set_browser_fontsize()},
365\method{set_browser_fontstyle()},
366\method{set_browser_specialkey()}.
Fred Drakefc576191998-04-04 07:15:02 +0000367\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000368
369%---
370
Fred Drakefc576191998-04-04 07:15:02 +0000371\begin{methoddesc}[form]{add_timer}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000372Add a timer object to the form. \\
373Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000374\method{set_timer()},
375\method{get_timer()}.
Fred Drakefc576191998-04-04 07:15:02 +0000376\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000377\end{flushleft}
378
379Form objects have the following data attributes; see the FORMS
380documentation:
381
Fred Drakeee601911998-04-11 20:53:03 +0000382\begin{tableiii}{l|l|l}{member}{Name}{C Type}{Meaning}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000383 \lineiii{window}{int (read-only)}{GL window id}
384 \lineiii{w}{float}{form width}
385 \lineiii{h}{float}{form height}
386 \lineiii{x}{float}{form x origin}
387 \lineiii{y}{float}{form y origin}
388 \lineiii{deactivated}{int}{nonzero if form is deactivated}
389 \lineiii{visible}{int}{nonzero if form is visible}
390 \lineiii{frozen}{int}{nonzero if form is frozen}
391 \lineiii{doublebuf}{int}{nonzero if double buffering on}
392\end{tableiii}
393
Guido van Rossum470be141995-03-17 16:07:09 +0000394\subsection{FORMS Objects}
Fred Drakefc576191998-04-04 07:15:02 +0000395\label{forms-objects}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000396
397Besides methods specific to particular kinds of FORMS objects, all
398FORMS objects also have the following methods:
399
Fred Drakefc576191998-04-04 07:15:02 +0000400\begin{methoddesc}[FORMS object]{set_call_back}{function, argument}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000401Set the object's callback function and argument. When the object
402needs interaction, the callback function will be called with two
403arguments: the object, and the callback argument. (FORMS objects
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000404without a callback function are returned by \function{fl.do_forms()}
405or \function{fl.check_forms()} when they need interaction.) Call this
406method without arguments to remove the callback function.
Fred Drakefc576191998-04-04 07:15:02 +0000407\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000408
Fred Drakefc576191998-04-04 07:15:02 +0000409\begin{methoddesc}[FORMS object]{delete_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000410 Delete the object.
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]{show_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000414 Show 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]{hide_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000418 Hide 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]{redraw_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000422 Redraw 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]{freeze_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000426 Freeze 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]{unfreeze_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000430 Unfreeze 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]{handle_object}{} XXX
434%\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_direct}{} XXX
437%\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000438
439FORMS objects have these data attributes; see the FORMS documentation:
440
Fred Drakeee601911998-04-11 20:53:03 +0000441\begin{tableiii}{l|l|l}{member}{Name}{C Type}{Meaning}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000442 \lineiii{objclass}{int (read-only)}{object class}
443 \lineiii{type}{int (read-only)}{object type}
444 \lineiii{boxtype}{int}{box type}
445 \lineiii{x}{float}{x origin}
446 \lineiii{y}{float}{y origin}
447 \lineiii{w}{float}{width}
448 \lineiii{h}{float}{height}
449 \lineiii{col1}{int}{primary color}
450 \lineiii{col2}{int}{secondary color}
451 \lineiii{align}{int}{alignment}
452 \lineiii{lcol}{int}{label color}
453 \lineiii{lsize}{float}{label font size}
454 \lineiii{label}{string}{label string}
455 \lineiii{lstyle}{int}{label style}
456 \lineiii{pushed}{int (read-only)}{(see FORMS docs)}
457 \lineiii{focus}{int (read-only)}{(see FORMS docs)}
458 \lineiii{belowmouse}{int (read-only)}{(see FORMS docs)}
459 \lineiii{frozen}{int (read-only)}{(see FORMS docs)}
460 \lineiii{active}{int (read-only)}{(see FORMS docs)}
461 \lineiii{input}{int (read-only)}{(see FORMS docs)}
462 \lineiii{visible}{int (read-only)}{(see FORMS docs)}
463 \lineiii{radio}{int (read-only)}{(see FORMS docs)}
464 \lineiii{automatic}{int (read-only)}{(see FORMS docs)}
465\end{tableiii}
466
Fred Drakefc576191998-04-04 07:15:02 +0000467\section{Standard Module \module{FL}}
Fred Drakeb91e9341998-07-23 17:59:49 +0000468\declaremodule{standard}{FL}
469
470\modulesynopsis{Constants used with the \module{fl} module.}
471
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000472
473This module defines symbolic constants needed to use the built-in
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000474module \module{fl} (see above); they are equivalent to those defined in
475the \C{} header file \code{<forms.h>} except that the name prefix
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000476\samp{FL_} is omitted. Read the module source for a complete list of
477the defined names. Suggested use:
478
Fred Drake19479911998-02-13 06:58:54 +0000479\begin{verbatim}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000480import fl
481from FL import *
Fred Drake19479911998-02-13 06:58:54 +0000482\end{verbatim}
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000483
Fred Drakefc576191998-04-04 07:15:02 +0000484\section{Standard Module \module{flp}}
Fred Drakeb91e9341998-07-23 17:59:49 +0000485\declaremodule{standard}{flp}
486
487\modulesynopsis{Loading functions for stored FORMS designs.}
488
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000489
490This module defines functions that can read form definitions created
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000491by the `form designer' (\program{fdesign}) program that comes with the
492FORMS library (see module \module{fl} above).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000493
494For now, see the file \file{flp.doc} in the Python library source
495directory for a description.
496
497XXX A complete description should be inserted here!