blob: 7ebec7dcf74a737398e2fb66a6851e693ca81966 [file] [log] [blame]
Fred Drakefc576191998-04-04 07:15:02 +00001\section{Built-in Module \module{fl}}
Guido van Rossume47da0a1997-07-17 16:34:52 +00002\label{module-fl}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00003\bimodindex{fl}
4
Fred Drake5f874d61998-03-15 01:59:57 +00005This module provides an interface to the FORMS Library\index{FORMS
6Library} by Mark Overmars\index{Overmars, Mark}. The source for the
7library can be retrieved by anonymous ftp from host
8\samp{ftp.cs.ruu.nl}, directory \file{SGI/FORMS}. It was last tested
9with version 2.0b.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000010
Fred Drake0cf0cfb1998-02-19 20:59:19 +000011Most functions are literal translations of their \C{} equivalents,
Guido van Rossum470be141995-03-17 16:07:09 +000012dropping the initial \samp{fl_} from their name. Constants used by
Fred Drake0cf0cfb1998-02-19 20:59:19 +000013the library are defined in module \module{FL} described below.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000014
15The creation of objects is a little different in Python than in C:
16instead of the `current form' maintained by the library to which new
17FORMS objects are added, all functions that add a FORMS object to a
Guido van Rossum470be141995-03-17 16:07:09 +000018form are methods of the Python object representing the form.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000019Consequently, there are no Python equivalents for the C functions
Fred Drake0cf0cfb1998-02-19 20:59:19 +000020\cfunction{fl_addto_form()} and \cfunction{fl_end_form()}, and the
21equivalent of \cfunction{fl_bgn_form()} is called
22\function{fl.make_form()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000023
24Watch out for the somewhat confusing terminology: FORMS uses the word
25\dfn{object} for the buttons, sliders etc. that you can place in a form.
26In Python, `object' means any value. The Python interface to FORMS
27introduces two new Python object types: form objects (representing an
28entire form) and FORMS objects (representing one button, slider etc.).
Fred Drake0cf0cfb1998-02-19 20:59:19 +000029Hopefully this isn't too confusing.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000030
31There are no `free objects' in the Python interface to FORMS, nor is
32there an easy way to add object classes written in Python. The FORMS
Guido van Rossum470be141995-03-17 16:07:09 +000033interface to GL event handling is available, though, so you can mix
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000034FORMS with pure GL windows.
35
Fred Drake0cf0cfb1998-02-19 20:59:19 +000036\strong{Please note:} importing \module{fl} implies a call to the GL
37function \cfunction{foreground()} and to the FORMS routine
38\cfunction{fl_init()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000039
Fred Drakefc576191998-04-04 07:15:02 +000040\subsection{Functions Defined in Module \module{fl}}
Guido van Rossum86cb0921995-03-20 12:59:56 +000041\nodename{FL Functions}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000042
Fred Drake0cf0cfb1998-02-19 20:59:19 +000043Module \module{fl} defines the following functions. For more
44information about what they do, see the description of the equivalent
45\C{} function in the FORMS documentation:
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000046
Fred Drake5f874d61998-03-15 01:59:57 +000047\begin{funcdesc}{make_form}{type, width, height}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000048Create a form with given type, width and height. This returns a
49\dfn{form} object, whose methods are described below.
50\end{funcdesc}
51
52\begin{funcdesc}{do_forms}{}
53The standard FORMS main loop. Returns a Python object representing
54the FORMS object needing interaction, or the special value
Fred Drake0cf0cfb1998-02-19 20:59:19 +000055\constant{FL.EVENT}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000056\end{funcdesc}
57
58\begin{funcdesc}{check_forms}{}
Fred Drake0cf0cfb1998-02-19 20:59:19 +000059Check for FORMS events. Returns what \function{do_forms()} above
60returns, or \code{None} if there is no event that immediately needs
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000061interaction.
62\end{funcdesc}
63
64\begin{funcdesc}{set_event_call_back}{function}
65Set the event callback function.
66\end{funcdesc}
67
Fred Drake5f874d61998-03-15 01:59:57 +000068\begin{funcdesc}{set_graphics_mode}{rgbmode, doublebuffering}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000069Set the graphics modes.
70\end{funcdesc}
71
72\begin{funcdesc}{get_rgbmode}{}
Fred Drake5f874d61998-03-15 01:59:57 +000073Return the current rgb mode. This is the value of the \C{} global
Fred Drake0cf0cfb1998-02-19 20:59:19 +000074variable \cdata{fl_rgbmode}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000075\end{funcdesc}
76
Fred Drake5f874d61998-03-15 01:59:57 +000077\begin{funcdesc}{show_message}{str1, str2, str3}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000078Show a dialog box with a three-line message and an OK button.
79\end{funcdesc}
80
Fred Drake5f874d61998-03-15 01:59:57 +000081\begin{funcdesc}{show_question}{str1, str2, str3}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000082Show a dialog box with a three-line message and YES and NO buttons.
83It returns \code{1} if the user pressed YES, \code{0} if NO.
84\end{funcdesc}
85
Fred Drakefc576191998-04-04 07:15:02 +000086\begin{funcdesc}{show_choice}{str1, str2, str3, but1\optional{,
87 but2\optional{, but3}}}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000088Show a dialog box with a three-line message and up to three buttons.
89It returns the number of the button clicked by the user
90(\code{1}, \code{2} or \code{3}).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000091\end{funcdesc}
92
Fred Drake5f874d61998-03-15 01:59:57 +000093\begin{funcdesc}{show_input}{prompt, default}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000094Show a dialog box with a one-line prompt message and text field in
95which the user can enter a string. The second argument is the default
96input string. It returns the string value as edited by the user.
97\end{funcdesc}
98
Fred Drake5f874d61998-03-15 01:59:57 +000099\begin{funcdesc}{show_file_selector}{message, directory, pattern, default}
Guido van Rossum470be141995-03-17 16:07:09 +0000100Show a dialog box in which the user can select a file. It returns
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000101the absolute filename selected by the user, or \code{None} if the user
102presses Cancel.
103\end{funcdesc}
104
105\begin{funcdesc}{get_directory}{}
106\funcline{get_pattern}{}
107\funcline{get_filename}{}
108These functions return the directory, pattern and filename (the tail
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000109part only) selected by the user in the last
110\function{show_file_selector()} call.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000111\end{funcdesc}
112
113\begin{funcdesc}{qdevice}{dev}
114\funcline{unqdevice}{dev}
115\funcline{isqueued}{dev}
116\funcline{qtest}{}
117\funcline{qread}{}
118%\funcline{blkqread}{?}
119\funcline{qreset}{}
Fred Drake5f874d61998-03-15 01:59:57 +0000120\funcline{qenter}{dev, val}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000121\funcline{get_mouse}{}
Fred Drake5f874d61998-03-15 01:59:57 +0000122\funcline{tie}{button, valuator1, valuator2}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000123These functions are the FORMS interfaces to the corresponding GL
124functions. Use these if you want to handle some GL events yourself
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000125when using \function{fl.do_events()}. When a GL event is detected that
126FORMS cannot handle, \function{fl.do_forms()} returns the special value
127\constant{FL.EVENT} and you should call \function{fl.qread()} to read
128the event from the queue. Don't use the equivalent GL functions!
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000129\end{funcdesc}
130
131\begin{funcdesc}{color}{}
132\funcline{mapcolor}{}
133\funcline{getmcolor}{}
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000134See the description in the FORMS documentation of
135\cfunction{fl_color()}, \cfunction{fl_mapcolor()} and
136\cfunction{fl_getmcolor()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000137\end{funcdesc}
138
Guido van Rossum470be141995-03-17 16:07:09 +0000139\subsection{Form Objects}
Fred Drakefc576191998-04-04 07:15:02 +0000140\label{form-objects}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000141
Fred Drakefc576191998-04-04 07:15:02 +0000142Form objects (returned by \function{make_form()} above) have the
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000143following methods. Each method corresponds to a \C{} function whose
144name is prefixed with \samp{fl_}; and whose first argument is a form
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000145pointer; please refer to the official FORMS documentation for
146descriptions.
147
Fred Drakefc576191998-04-04 07:15:02 +0000148All the \method{add_*()} methods return a Python object representing
149the FORMS object. Methods of FORMS objects are described below. Most
150kinds of FORMS object also have some methods specific to that kind;
151these methods are listed here.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000152
153\begin{flushleft}
Fred Drakefc576191998-04-04 07:15:02 +0000154
155\begin{methoddesc}[form]{show_form}{placement, bordertype, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000156 Show the form.
Fred Drakefc576191998-04-04 07:15:02 +0000157\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000158
Fred Drakefc576191998-04-04 07:15:02 +0000159\begin{methoddesc}[form]{hide_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000160 Hide the form.
Fred Drakefc576191998-04-04 07:15:02 +0000161\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000162
Fred Drakefc576191998-04-04 07:15:02 +0000163\begin{methoddesc}[form]{redraw_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000164 Redraw the form.
Fred Drakefc576191998-04-04 07:15:02 +0000165\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000166
Fred Drakefc576191998-04-04 07:15:02 +0000167\begin{methoddesc}[form]{set_form_position}{x, y}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000168Set the form's position.
Fred Drakefc576191998-04-04 07:15:02 +0000169\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000170
Fred Drakefc576191998-04-04 07:15:02 +0000171\begin{methoddesc}[form]{freeze_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000172Freeze the form.
Fred Drakefc576191998-04-04 07:15:02 +0000173\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000174
Fred Drakefc576191998-04-04 07:15:02 +0000175\begin{methoddesc}[form]{unfreeze_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000176 Unfreeze the form.
Fred Drakefc576191998-04-04 07:15:02 +0000177\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000178
Fred Drakefc576191998-04-04 07:15:02 +0000179\begin{methoddesc}[form]{activate_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000180 Activate the form.
Fred Drakefc576191998-04-04 07:15:02 +0000181\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000182
Fred Drakefc576191998-04-04 07:15:02 +0000183\begin{methoddesc}[form]{deactivate_form}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000184 Deactivate the form.
Fred Drakefc576191998-04-04 07:15:02 +0000185\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000186
Fred Drakefc576191998-04-04 07:15:02 +0000187\begin{methoddesc}[form]{bgn_group}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000188 Begin a new group of objects; return a group object.
Fred Drakefc576191998-04-04 07:15:02 +0000189\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000190
Fred Drakefc576191998-04-04 07:15:02 +0000191\begin{methoddesc}[form]{end_group}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000192 End the current group of objects.
Fred Drakefc576191998-04-04 07:15:02 +0000193\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000194
Fred Drakefc576191998-04-04 07:15:02 +0000195\begin{methoddesc}[form]{find_first}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000196 Find the first object in the form.
Fred Drakefc576191998-04-04 07:15:02 +0000197\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000198
Fred Drakefc576191998-04-04 07:15:02 +0000199\begin{methoddesc}[form]{find_last}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000200 Find the last object in the form.
Fred Drakefc576191998-04-04 07:15:02 +0000201\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000202
203%---
204
Fred Drakefc576191998-04-04 07:15:02 +0000205\begin{methoddesc}[form]{add_box}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000206Add a box object to the form.
207No extra methods.
Fred Drakefc576191998-04-04 07:15:02 +0000208\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000209
Fred Drakefc576191998-04-04 07:15:02 +0000210\begin{methoddesc}[form]{add_text}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000211Add a text 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_bitmap}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000216%Add a bitmap object to the form.
Fred Drakefc576191998-04-04 07:15:02 +0000217%\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000218
Fred Drakefc576191998-04-04 07:15:02 +0000219\begin{methoddesc}[form]{add_clock}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000220Add a clock object to the form. \\
221Method:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000222\method{get_clock()}.
Fred Drakefc576191998-04-04 07:15:02 +0000223\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000224
225%---
226
Fred Drakefc576191998-04-04 07:15:02 +0000227\begin{methoddesc}[form]{add_button}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000228Add a button object to the form. \\
229Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000230\method{get_button()},
231\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000232\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000233
Fred Drakefc576191998-04-04 07:15:02 +0000234\begin{methoddesc}[form]{add_lightbutton}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000235Add a lightbutton object to the form. \\
236Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000237\method{get_button()},
238\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000239\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000240
Fred Drakefc576191998-04-04 07:15:02 +0000241\begin{methoddesc}[form]{add_roundbutton}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000242Add a roundbutton object to the form. \\
243Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000244\method{get_button()},
245\method{set_button()}.
Fred Drakefc576191998-04-04 07:15:02 +0000246\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000247
248%---
249
Fred Drakefc576191998-04-04 07:15:02 +0000250\begin{methoddesc}[form]{add_slider}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000251Add a slider object to the form. \\
252Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000253\method{set_slider_value()},
254\method{get_slider_value()},
255\method{set_slider_bounds()},
256\method{get_slider_bounds()},
257\method{set_slider_return()},
258\method{set_slider_size()},
259\method{set_slider_precision()},
260\method{set_slider_step()}.
Fred Drakefc576191998-04-04 07:15:02 +0000261\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000262
Fred Drakefc576191998-04-04 07:15:02 +0000263\begin{methoddesc}[form]{add_valslider}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000264Add a valslider object to the form. \\
265Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000266\method{set_slider_value()},
267\method{get_slider_value()},
268\method{set_slider_bounds()},
269\method{get_slider_bounds()},
270\method{set_slider_return()},
271\method{set_slider_size()},
272\method{set_slider_precision()},
273\method{set_slider_step()}.
Fred Drakefc576191998-04-04 07:15:02 +0000274\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000275
Fred Drakefc576191998-04-04 07:15:02 +0000276\begin{methoddesc}[form]{add_dial}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000277Add a dial object to the form. \\
278Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000279\method{set_dial_value()},
280\method{get_dial_value()},
281\method{set_dial_bounds()},
282\method{get_dial_bounds()}.
Fred Drakefc576191998-04-04 07:15:02 +0000283\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000284
Fred Drakefc576191998-04-04 07:15:02 +0000285\begin{methoddesc}[form]{add_positioner}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000286Add a positioner object to the form. \\
287Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000288\method{set_positioner_xvalue()},
289\method{set_positioner_yvalue()},
290\method{set_positioner_xbounds()},
291\method{set_positioner_ybounds()},
292\method{get_positioner_xvalue()},
293\method{get_positioner_yvalue()},
294\method{get_positioner_xbounds()},
295\method{get_positioner_ybounds()}.
Fred Drakefc576191998-04-04 07:15:02 +0000296\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000297
Fred Drakefc576191998-04-04 07:15:02 +0000298\begin{methoddesc}[form]{add_counter}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000299Add a counter object to the form. \\
300Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000301\method{set_counter_value()},
302\method{get_counter_value()},
303\method{set_counter_bounds()},
304\method{set_counter_step()},
305\method{set_counter_precision()},
306\method{set_counter_return()}.
Fred Drakefc576191998-04-04 07:15:02 +0000307\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000308
309%---
310
Fred Drakefc576191998-04-04 07:15:02 +0000311\begin{methoddesc}[form]{add_input}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000312Add a input object to the form. \\
313Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000314\method{set_input()},
315\method{get_input()},
316\method{set_input_color()},
317\method{set_input_return()}.
Fred Drakefc576191998-04-04 07:15:02 +0000318\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000319
320%---
321
Fred Drakefc576191998-04-04 07:15:02 +0000322\begin{methoddesc}[form]{add_menu}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000323Add a menu object to the form. \\
324Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000325\method{set_menu()},
326\method{get_menu()},
327\method{addto_menu()}.
Fred Drakefc576191998-04-04 07:15:02 +0000328\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000329
Fred Drakefc576191998-04-04 07:15:02 +0000330\begin{methoddesc}[form]{add_choice}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000331Add a choice object to the form. \\
332Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000333\method{set_choice()},
334\method{get_choice()},
335\method{clear_choice()},
336\method{addto_choice()},
337\method{replace_choice()},
338\method{delete_choice()},
339\method{get_choice_text()},
340\method{set_choice_fontsize()},
341\method{set_choice_fontstyle()}.
Fred Drakefc576191998-04-04 07:15:02 +0000342\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000343
Fred Drakefc576191998-04-04 07:15:02 +0000344\begin{methoddesc}[form]{add_browser}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000345Add a browser object to the form. \\
346Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000347\method{set_browser_topline()},
348\method{clear_browser()},
349\method{add_browser_line()},
350\method{addto_browser()},
351\method{insert_browser_line()},
352\method{delete_browser_line()},
353\method{replace_browser_line()},
354\method{get_browser_line()},
355\method{load_browser()},
356\method{get_browser_maxline()},
357\method{select_browser_line()},
358\method{deselect_browser_line()},
359\method{deselect_browser()},
360\method{isselected_browser_line()},
361\method{get_browser()},
362\method{set_browser_fontsize()},
363\method{set_browser_fontstyle()},
364\method{set_browser_specialkey()}.
Fred Drakefc576191998-04-04 07:15:02 +0000365\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000366
367%---
368
Fred Drakefc576191998-04-04 07:15:02 +0000369\begin{methoddesc}[form]{add_timer}{type, x, y, w, h, name}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000370Add a timer object to the form. \\
371Methods:
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000372\method{set_timer()},
373\method{get_timer()}.
Fred Drakefc576191998-04-04 07:15:02 +0000374\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000375\end{flushleft}
376
377Form objects have the following data attributes; see the FORMS
378documentation:
379
Fred Drakeee601911998-04-11 20:53:03 +0000380\begin{tableiii}{l|l|l}{member}{Name}{C Type}{Meaning}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000381 \lineiii{window}{int (read-only)}{GL window id}
382 \lineiii{w}{float}{form width}
383 \lineiii{h}{float}{form height}
384 \lineiii{x}{float}{form x origin}
385 \lineiii{y}{float}{form y origin}
386 \lineiii{deactivated}{int}{nonzero if form is deactivated}
387 \lineiii{visible}{int}{nonzero if form is visible}
388 \lineiii{frozen}{int}{nonzero if form is frozen}
389 \lineiii{doublebuf}{int}{nonzero if double buffering on}
390\end{tableiii}
391
Guido van Rossum470be141995-03-17 16:07:09 +0000392\subsection{FORMS Objects}
Fred Drakefc576191998-04-04 07:15:02 +0000393\label{forms-objects}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000394
395Besides methods specific to particular kinds of FORMS objects, all
396FORMS objects also have the following methods:
397
Fred Drakefc576191998-04-04 07:15:02 +0000398\begin{methoddesc}[FORMS object]{set_call_back}{function, argument}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000399Set the object's callback function and argument. When the object
400needs interaction, the callback function will be called with two
401arguments: the object, and the callback argument. (FORMS objects
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000402without a callback function are returned by \function{fl.do_forms()}
403or \function{fl.check_forms()} when they need interaction.) Call this
404method without arguments to remove the callback function.
Fred Drakefc576191998-04-04 07:15:02 +0000405\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000406
Fred Drakefc576191998-04-04 07:15:02 +0000407\begin{methoddesc}[FORMS object]{delete_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000408 Delete the object.
Fred Drakefc576191998-04-04 07:15:02 +0000409\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000410
Fred Drakefc576191998-04-04 07:15:02 +0000411\begin{methoddesc}[FORMS object]{show_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000412 Show the object.
Fred Drakefc576191998-04-04 07:15:02 +0000413\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000414
Fred Drakefc576191998-04-04 07:15:02 +0000415\begin{methoddesc}[FORMS object]{hide_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000416 Hide the object.
Fred Drakefc576191998-04-04 07:15:02 +0000417\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000418
Fred Drakefc576191998-04-04 07:15:02 +0000419\begin{methoddesc}[FORMS object]{redraw_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000420 Redraw the object.
Fred Drakefc576191998-04-04 07:15:02 +0000421\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000422
Fred Drakefc576191998-04-04 07:15:02 +0000423\begin{methoddesc}[FORMS object]{freeze_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000424 Freeze the object.
Fred Drakefc576191998-04-04 07:15:02 +0000425\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000426
Fred Drakefc576191998-04-04 07:15:02 +0000427\begin{methoddesc}[FORMS object]{unfreeze_object}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000428 Unfreeze the object.
Fred Drakefc576191998-04-04 07:15:02 +0000429\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000430
Fred Drakefc576191998-04-04 07:15:02 +0000431%\begin{methoddesc}[FORMS object]{handle_object}{} XXX
432%\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000433
Fred Drakefc576191998-04-04 07:15:02 +0000434%\begin{methoddesc}[FORMS object]{handle_object_direct}{} XXX
435%\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000436
437FORMS objects have these data attributes; see the FORMS documentation:
438
Fred Drakeee601911998-04-11 20:53:03 +0000439\begin{tableiii}{l|l|l}{member}{Name}{C Type}{Meaning}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000440 \lineiii{objclass}{int (read-only)}{object class}
441 \lineiii{type}{int (read-only)}{object type}
442 \lineiii{boxtype}{int}{box type}
443 \lineiii{x}{float}{x origin}
444 \lineiii{y}{float}{y origin}
445 \lineiii{w}{float}{width}
446 \lineiii{h}{float}{height}
447 \lineiii{col1}{int}{primary color}
448 \lineiii{col2}{int}{secondary color}
449 \lineiii{align}{int}{alignment}
450 \lineiii{lcol}{int}{label color}
451 \lineiii{lsize}{float}{label font size}
452 \lineiii{label}{string}{label string}
453 \lineiii{lstyle}{int}{label style}
454 \lineiii{pushed}{int (read-only)}{(see FORMS docs)}
455 \lineiii{focus}{int (read-only)}{(see FORMS docs)}
456 \lineiii{belowmouse}{int (read-only)}{(see FORMS docs)}
457 \lineiii{frozen}{int (read-only)}{(see FORMS docs)}
458 \lineiii{active}{int (read-only)}{(see FORMS docs)}
459 \lineiii{input}{int (read-only)}{(see FORMS docs)}
460 \lineiii{visible}{int (read-only)}{(see FORMS docs)}
461 \lineiii{radio}{int (read-only)}{(see FORMS docs)}
462 \lineiii{automatic}{int (read-only)}{(see FORMS docs)}
463\end{tableiii}
464
Fred Drakefc576191998-04-04 07:15:02 +0000465\section{Standard Module \module{FL}}
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000466\label{module-FLuppercase}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000467\stmodindex{FL}
468
469This module defines symbolic constants needed to use the built-in
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000470module \module{fl} (see above); they are equivalent to those defined in
471the \C{} header file \code{<forms.h>} except that the name prefix
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000472\samp{FL_} is omitted. Read the module source for a complete list of
473the defined names. Suggested use:
474
Fred Drake19479911998-02-13 06:58:54 +0000475\begin{verbatim}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000476import fl
477from FL import *
Fred Drake19479911998-02-13 06:58:54 +0000478\end{verbatim}
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000479
Fred Drakefc576191998-04-04 07:15:02 +0000480\section{Standard Module \module{flp}}
Fred Drakeb2151371998-01-14 05:47:15 +0000481\label{module-flp}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000482\stmodindex{flp}
483
484This module defines functions that can read form definitions created
Fred Drake0cf0cfb1998-02-19 20:59:19 +0000485by the `form designer' (\program{fdesign}) program that comes with the
486FORMS library (see module \module{fl} above).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000487
488For now, see the file \file{flp.doc} in the Python library source
489directory for a description.
490
491XXX A complete description should be inserted here!