Platforms: IRIX
Deprecated since version 2.6: The fl module has been deprecated for removal in Python 3.0.
This module provides an interface to the FORMS Library by Mark Overmars. The source for the library can be retrieved by anonymous ftp from host ftp.cs.ruu.nl, directory SGI/FORMS. It was last tested with version 2.0b.
Most functions are literal translations of their C equivalents, dropping the initial fl_ from their name. Constants used by the library are defined in module FL described below.
The creation of objects is a little different in Python than in C: instead of the ‘current form’ maintained by the library to which new FORMS objects are added, all functions that add a FORMS object to a form are methods of the Python object representing the form. Consequently, there are no Python equivalents for the C functions fl_addto_form() and fl_end_form(), and the equivalent of fl_bgn_form() is called fl.make_form().
Watch out for the somewhat confusing terminology: FORMS uses the word object for the buttons, sliders etc. that you can place in a form. In Python, ‘object’ means any value. The Python interface to FORMS introduces two new Python object types: form objects (representing an entire form) and FORMS objects (representing one button, slider etc.). Hopefully this isn’t too confusing.
There are no ‘free objects’ in the Python interface to FORMS, nor is there an easy way to add object classes written in Python. The FORMS interface to GL event handling is available, though, so you can mix FORMS with pure GL windows.
Please note: importing fl implies a call to the GL function foreground() and to the FORMS routine fl_init().
Module fl defines the following functions. For more information about what they do, see the description of the equivalent C function in the FORMS documentation:
Form objects (returned by make_form() above) have the following methods. Each method corresponds to a C function whose name is prefixed with fl_; and whose first argument is a form pointer; please refer to the official FORMS documentation for descriptions.
All the add_*() methods return a Python object representing the FORMS object. Methods of FORMS objects are described below. Most kinds of FORMS object also have some methods specific to that kind; these methods are listed here.
Form objects have the following data attributes; see the FORMS documentation:
Name | C Type | Meaning |
---|---|---|
window | int (read-only) | GL window id |
w | float | form width |
h | float | form height |
x | float | form x origin |
y | float | form y origin |
deactivated | int | nonzero if form is deactivated |
visible | int | nonzero if form is visible |
frozen | int | nonzero if form is frozen |
doublebuf | int | nonzero if double buffering on |
Besides methods specific to particular kinds of FORMS objects, all FORMS objects also have the following methods:
FORMS objects have these data attributes; see the FORMS documentation:
Name | C Type | Meaning |
---|---|---|
objclass | int (read-only) | object class |
type | int (read-only) | object type |
boxtype | int | box type |
x | float | x origin |
y | float | y origin |
w | float | width |
h | float | height |
col1 | int | primary color |
col2 | int | secondary color |
align | int | alignment |
lcol | int | label color |
lsize | float | label font size |
label | string | label string |
lstyle | int | label style |
pushed | int (read-only) | (see FORMS docs) |
focus | int (read-only) | (see FORMS docs) |
belowmouse | int (read-only) | (see FORMS docs) |
frozen | int (read-only) | (see FORMS docs) |
active | int (read-only) | (see FORMS docs) |
input | int (read-only) | (see FORMS docs) |
visible | int (read-only) | (see FORMS docs) |
radio | int (read-only) | (see FORMS docs) |
automatic | int (read-only) | (see FORMS docs) |
Platforms: IRIX
Deprecated since version 2.6: The FL module has been deprecated for removal in Python 3.0.
This module defines symbolic constants needed to use the built-in module fl (see above); they are equivalent to those defined in the C header file <forms.h> except that the name prefix FL_ is omitted. Read the module source for a complete list of the defined names. Suggested use:
import fl
from FL import *
Platforms: IRIX
Deprecated since version 2.6: The flp module has been deprecated for removal in Python 3.0.
This module defines functions that can read form definitions created by the ‘form designer’ (fdesign) program that comes with the FORMS library (see module fl above).
For now, see the file flp.doc in the Python library source directory for a description.
XXX A complete description should be inserted here!