Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 1 | \section{Built-in Module \sectcode{fl}} |
Guido van Rossum | e47da0a | 1997-07-17 16:34:52 +0000 | [diff] [blame] | 2 | \label{module-fl} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 3 | \bimodindex{fl} |
| 4 | |
| 5 | This module provides an interface to the FORMS Library by Mark |
Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 6 | Overmars. The source for the library can be retrieved by anonymous |
| 7 | ftp from host \samp{ftp.cs.ruu.nl}, directory \file{SGI/FORMS}. It |
| 8 | was last tested with version 2.0b. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 9 | |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 10 | Most functions are literal translations of their \C{} equivalents, |
Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 11 | dropping the initial \samp{fl_} from their name. Constants used by |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 12 | the library are defined in module \module{FL} described below. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 13 | |
| 14 | The creation of objects is a little different in Python than in C: |
| 15 | instead of the `current form' maintained by the library to which new |
| 16 | FORMS objects are added, all functions that add a FORMS object to a |
Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 17 | form are methods of the Python object representing the form. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 18 | Consequently, there are no Python equivalents for the C functions |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 19 | \cfunction{fl_addto_form()} and \cfunction{fl_end_form()}, and the |
| 20 | equivalent of \cfunction{fl_bgn_form()} is called |
| 21 | \function{fl.make_form()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 22 | |
| 23 | Watch out for the somewhat confusing terminology: FORMS uses the word |
| 24 | \dfn{object} for the buttons, sliders etc. that you can place in a form. |
| 25 | In Python, `object' means any value. The Python interface to FORMS |
| 26 | introduces two new Python object types: form objects (representing an |
| 27 | entire form) and FORMS objects (representing one button, slider etc.). |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 28 | Hopefully this isn't too confusing. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 29 | |
| 30 | There are no `free objects' in the Python interface to FORMS, nor is |
| 31 | there an easy way to add object classes written in Python. The FORMS |
Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 32 | interface to GL event handling is available, though, so you can mix |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 33 | FORMS with pure GL windows. |
| 34 | |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 35 | \strong{Please note:} importing \module{fl} implies a call to the GL |
| 36 | function \cfunction{foreground()} and to the FORMS routine |
| 37 | \cfunction{fl_init()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 38 | |
Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 39 | \subsection{Functions Defined in Module \sectcode{fl}} |
Guido van Rossum | 86cb092 | 1995-03-20 12:59:56 +0000 | [diff] [blame] | 40 | \nodename{FL Functions} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 41 | |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 42 | Module \module{fl} defines the following functions. For more |
| 43 | information about what they do, see the description of the equivalent |
| 44 | \C{} function in the FORMS documentation: |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 45 | |
Fred Drake | 1947991 | 1998-02-13 06:58:54 +0000 | [diff] [blame] | 46 | \setindexsubitem{(in module fl)} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 47 | \begin{funcdesc}{make_form}{type\, width\, height} |
| 48 | Create 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}{} |
| 53 | The standard FORMS main loop. Returns a Python object representing |
| 54 | the FORMS object needing interaction, or the special value |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 55 | \constant{FL.EVENT}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 56 | \end{funcdesc} |
| 57 | |
| 58 | \begin{funcdesc}{check_forms}{} |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 59 | Check for FORMS events. Returns what \function{do_forms()} above |
| 60 | returns, or \code{None} if there is no event that immediately needs |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 61 | interaction. |
| 62 | \end{funcdesc} |
| 63 | |
| 64 | \begin{funcdesc}{set_event_call_back}{function} |
| 65 | Set the event callback function. |
| 66 | \end{funcdesc} |
| 67 | |
| 68 | \begin{funcdesc}{set_graphics_mode}{rgbmode\, doublebuffering} |
| 69 | Set the graphics modes. |
| 70 | \end{funcdesc} |
| 71 | |
| 72 | \begin{funcdesc}{get_rgbmode}{} |
| 73 | Return the current rgb mode. This is the value of the C global |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 74 | variable \cdata{fl_rgbmode}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 75 | \end{funcdesc} |
| 76 | |
| 77 | \begin{funcdesc}{show_message}{str1\, str2\, str3} |
| 78 | Show a dialog box with a three-line message and an OK button. |
| 79 | \end{funcdesc} |
| 80 | |
| 81 | \begin{funcdesc}{show_question}{str1\, str2\, str3} |
| 82 | Show a dialog box with a three-line message and YES and NO buttons. |
| 83 | It returns \code{1} if the user pressed YES, \code{0} if NO. |
| 84 | \end{funcdesc} |
| 85 | |
Fred Drake | 1b6cf78 | 1997-12-29 20:28:33 +0000 | [diff] [blame] | 86 | \begin{funcdesc}{show_choice}{str1, str2, str3, but1\optional{, but2, but3}} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 87 | Show a dialog box with a three-line message and up to three buttons. |
| 88 | It returns the number of the button clicked by the user |
| 89 | (\code{1}, \code{2} or \code{3}). |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 90 | \end{funcdesc} |
| 91 | |
| 92 | \begin{funcdesc}{show_input}{prompt\, default} |
| 93 | Show a dialog box with a one-line prompt message and text field in |
| 94 | which the user can enter a string. The second argument is the default |
| 95 | input string. It returns the string value as edited by the user. |
| 96 | \end{funcdesc} |
| 97 | |
| 98 | \begin{funcdesc}{show_file_selector}{message\, directory\, pattern\, default} |
Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 99 | Show a dialog box in which the user can select a file. It returns |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 100 | the absolute filename selected by the user, or \code{None} if the user |
| 101 | presses Cancel. |
| 102 | \end{funcdesc} |
| 103 | |
| 104 | \begin{funcdesc}{get_directory}{} |
| 105 | \funcline{get_pattern}{} |
| 106 | \funcline{get_filename}{} |
| 107 | These functions return the directory, pattern and filename (the tail |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 108 | part only) selected by the user in the last |
| 109 | \function{show_file_selector()} call. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 110 | \end{funcdesc} |
| 111 | |
| 112 | \begin{funcdesc}{qdevice}{dev} |
| 113 | \funcline{unqdevice}{dev} |
| 114 | \funcline{isqueued}{dev} |
| 115 | \funcline{qtest}{} |
| 116 | \funcline{qread}{} |
| 117 | %\funcline{blkqread}{?} |
| 118 | \funcline{qreset}{} |
| 119 | \funcline{qenter}{dev\, val} |
| 120 | \funcline{get_mouse}{} |
| 121 | \funcline{tie}{button\, valuator1\, valuator2} |
| 122 | These functions are the FORMS interfaces to the corresponding GL |
| 123 | functions. Use these if you want to handle some GL events yourself |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 124 | when using \function{fl.do_events()}. When a GL event is detected that |
| 125 | FORMS cannot handle, \function{fl.do_forms()} returns the special value |
| 126 | \constant{FL.EVENT} and you should call \function{fl.qread()} to read |
| 127 | the event from the queue. Don't use the equivalent GL functions! |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 128 | \end{funcdesc} |
| 129 | |
| 130 | \begin{funcdesc}{color}{} |
| 131 | \funcline{mapcolor}{} |
| 132 | \funcline{getmcolor}{} |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 133 | See the description in the FORMS documentation of |
| 134 | \cfunction{fl_color()}, \cfunction{fl_mapcolor()} and |
| 135 | \cfunction{fl_getmcolor()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 136 | \end{funcdesc} |
| 137 | |
Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 138 | \subsection{Form Objects} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 139 | |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 140 | Form objects (returned by \function{fl.make_form()} above) have the |
| 141 | following methods. Each method corresponds to a \C{} function whose |
| 142 | name is prefixed with \samp{fl_}; and whose first argument is a form |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 143 | pointer; please refer to the official FORMS documentation for |
| 144 | descriptions. |
| 145 | |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 146 | All the \samp{add_{\rm \ldots}} functions return a Python object |
| 147 | representing the FORMS object. Methods of FORMS objects are described |
| 148 | below. Most kinds of FORMS object also have some methods specific to |
| 149 | that kind; these methods are listed here. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 150 | |
| 151 | \begin{flushleft} |
Fred Drake | 1947991 | 1998-02-13 06:58:54 +0000 | [diff] [blame] | 152 | \setindexsubitem{(form object method)} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 153 | \begin{funcdesc}{show_form}{placement\, bordertype\, name} |
| 154 | Show the form. |
| 155 | \end{funcdesc} |
| 156 | |
| 157 | \begin{funcdesc}{hide_form}{} |
| 158 | Hide the form. |
| 159 | \end{funcdesc} |
| 160 | |
| 161 | \begin{funcdesc}{redraw_form}{} |
| 162 | Redraw the form. |
| 163 | \end{funcdesc} |
| 164 | |
| 165 | \begin{funcdesc}{set_form_position}{x\, y} |
| 166 | Set the form's position. |
| 167 | \end{funcdesc} |
| 168 | |
| 169 | \begin{funcdesc}{freeze_form}{} |
| 170 | Freeze the form. |
| 171 | \end{funcdesc} |
| 172 | |
| 173 | \begin{funcdesc}{unfreeze_form}{} |
| 174 | Unfreeze the form. |
| 175 | \end{funcdesc} |
| 176 | |
| 177 | \begin{funcdesc}{activate_form}{} |
| 178 | Activate the form. |
| 179 | \end{funcdesc} |
| 180 | |
| 181 | \begin{funcdesc}{deactivate_form}{} |
| 182 | Deactivate the form. |
| 183 | \end{funcdesc} |
| 184 | |
| 185 | \begin{funcdesc}{bgn_group}{} |
| 186 | Begin a new group of objects; return a group object. |
| 187 | \end{funcdesc} |
| 188 | |
| 189 | \begin{funcdesc}{end_group}{} |
| 190 | End the current group of objects. |
| 191 | \end{funcdesc} |
| 192 | |
| 193 | \begin{funcdesc}{find_first}{} |
| 194 | Find the first object in the form. |
| 195 | \end{funcdesc} |
| 196 | |
| 197 | \begin{funcdesc}{find_last}{} |
| 198 | Find the last object in the form. |
| 199 | \end{funcdesc} |
| 200 | |
| 201 | %--- |
| 202 | |
| 203 | \begin{funcdesc}{add_box}{type\, x\, y\, w\, h\, name} |
| 204 | Add a box object to the form. |
| 205 | No extra methods. |
| 206 | \end{funcdesc} |
| 207 | |
| 208 | \begin{funcdesc}{add_text}{type\, x\, y\, w\, h\, name} |
| 209 | Add a text object to the form. |
| 210 | No extra methods. |
| 211 | \end{funcdesc} |
| 212 | |
| 213 | %\begin{funcdesc}{add_bitmap}{type\, x\, y\, w\, h\, name} |
| 214 | %Add a bitmap object to the form. |
| 215 | %\end{funcdesc} |
| 216 | |
| 217 | \begin{funcdesc}{add_clock}{type\, x\, y\, w\, h\, name} |
| 218 | Add a clock object to the form. \\ |
| 219 | Method: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 220 | \method{get_clock()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 221 | \end{funcdesc} |
| 222 | |
| 223 | %--- |
| 224 | |
| 225 | \begin{funcdesc}{add_button}{type\, x\, y\, w\, h\, name} |
| 226 | Add a button object to the form. \\ |
| 227 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 228 | \method{get_button()}, |
| 229 | \method{set_button()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 230 | \end{funcdesc} |
| 231 | |
| 232 | \begin{funcdesc}{add_lightbutton}{type\, x\, y\, w\, h\, name} |
| 233 | Add a lightbutton object to the form. \\ |
| 234 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 235 | \method{get_button()}, |
| 236 | \method{set_button()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 237 | \end{funcdesc} |
| 238 | |
| 239 | \begin{funcdesc}{add_roundbutton}{type\, x\, y\, w\, h\, name} |
| 240 | Add a roundbutton object to the form. \\ |
| 241 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 242 | \method{get_button()}, |
| 243 | \method{set_button()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 244 | \end{funcdesc} |
| 245 | |
| 246 | %--- |
| 247 | |
| 248 | \begin{funcdesc}{add_slider}{type\, x\, y\, w\, h\, name} |
| 249 | Add a slider object to the form. \\ |
| 250 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 251 | \method{set_slider_value()}, |
| 252 | \method{get_slider_value()}, |
| 253 | \method{set_slider_bounds()}, |
| 254 | \method{get_slider_bounds()}, |
| 255 | \method{set_slider_return()}, |
| 256 | \method{set_slider_size()}, |
| 257 | \method{set_slider_precision()}, |
| 258 | \method{set_slider_step()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 259 | \end{funcdesc} |
| 260 | |
| 261 | \begin{funcdesc}{add_valslider}{type\, x\, y\, w\, h\, name} |
| 262 | Add a valslider object to the form. \\ |
| 263 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 264 | \method{set_slider_value()}, |
| 265 | \method{get_slider_value()}, |
| 266 | \method{set_slider_bounds()}, |
| 267 | \method{get_slider_bounds()}, |
| 268 | \method{set_slider_return()}, |
| 269 | \method{set_slider_size()}, |
| 270 | \method{set_slider_precision()}, |
| 271 | \method{set_slider_step()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 272 | \end{funcdesc} |
| 273 | |
| 274 | \begin{funcdesc}{add_dial}{type\, x\, y\, w\, h\, name} |
| 275 | Add a dial object to the form. \\ |
| 276 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 277 | \method{set_dial_value()}, |
| 278 | \method{get_dial_value()}, |
| 279 | \method{set_dial_bounds()}, |
| 280 | \method{get_dial_bounds()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 281 | \end{funcdesc} |
| 282 | |
| 283 | \begin{funcdesc}{add_positioner}{type\, x\, y\, w\, h\, name} |
| 284 | Add a positioner object to the form. \\ |
| 285 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 286 | \method{set_positioner_xvalue()}, |
| 287 | \method{set_positioner_yvalue()}, |
| 288 | \method{set_positioner_xbounds()}, |
| 289 | \method{set_positioner_ybounds()}, |
| 290 | \method{get_positioner_xvalue()}, |
| 291 | \method{get_positioner_yvalue()}, |
| 292 | \method{get_positioner_xbounds()}, |
| 293 | \method{get_positioner_ybounds()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 294 | \end{funcdesc} |
| 295 | |
| 296 | \begin{funcdesc}{add_counter}{type\, x\, y\, w\, h\, name} |
| 297 | Add a counter object to the form. \\ |
| 298 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 299 | \method{set_counter_value()}, |
| 300 | \method{get_counter_value()}, |
| 301 | \method{set_counter_bounds()}, |
| 302 | \method{set_counter_step()}, |
| 303 | \method{set_counter_precision()}, |
| 304 | \method{set_counter_return()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 305 | \end{funcdesc} |
| 306 | |
| 307 | %--- |
| 308 | |
| 309 | \begin{funcdesc}{add_input}{type\, x\, y\, w\, h\, name} |
| 310 | Add a input object to the form. \\ |
| 311 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 312 | \method{set_input()}, |
| 313 | \method{get_input()}, |
| 314 | \method{set_input_color()}, |
| 315 | \method{set_input_return()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 316 | \end{funcdesc} |
| 317 | |
| 318 | %--- |
| 319 | |
| 320 | \begin{funcdesc}{add_menu}{type\, x\, y\, w\, h\, name} |
| 321 | Add a menu object to the form. \\ |
| 322 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 323 | \method{set_menu()}, |
| 324 | \method{get_menu()}, |
| 325 | \method{addto_menu()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 326 | \end{funcdesc} |
| 327 | |
| 328 | \begin{funcdesc}{add_choice}{type\, x\, y\, w\, h\, name} |
| 329 | Add a choice object to the form. \\ |
| 330 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 331 | \method{set_choice()}, |
| 332 | \method{get_choice()}, |
| 333 | \method{clear_choice()}, |
| 334 | \method{addto_choice()}, |
| 335 | \method{replace_choice()}, |
| 336 | \method{delete_choice()}, |
| 337 | \method{get_choice_text()}, |
| 338 | \method{set_choice_fontsize()}, |
| 339 | \method{set_choice_fontstyle()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 340 | \end{funcdesc} |
| 341 | |
| 342 | \begin{funcdesc}{add_browser}{type\, x\, y\, w\, h\, name} |
| 343 | Add a browser object to the form. \\ |
| 344 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 345 | \method{set_browser_topline()}, |
| 346 | \method{clear_browser()}, |
| 347 | \method{add_browser_line()}, |
| 348 | \method{addto_browser()}, |
| 349 | \method{insert_browser_line()}, |
| 350 | \method{delete_browser_line()}, |
| 351 | \method{replace_browser_line()}, |
| 352 | \method{get_browser_line()}, |
| 353 | \method{load_browser()}, |
| 354 | \method{get_browser_maxline()}, |
| 355 | \method{select_browser_line()}, |
| 356 | \method{deselect_browser_line()}, |
| 357 | \method{deselect_browser()}, |
| 358 | \method{isselected_browser_line()}, |
| 359 | \method{get_browser()}, |
| 360 | \method{set_browser_fontsize()}, |
| 361 | \method{set_browser_fontstyle()}, |
| 362 | \method{set_browser_specialkey()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 363 | \end{funcdesc} |
| 364 | |
| 365 | %--- |
| 366 | |
| 367 | \begin{funcdesc}{add_timer}{type\, x\, y\, w\, h\, name} |
| 368 | Add a timer object to the form. \\ |
| 369 | Methods: |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 370 | \method{set_timer()}, |
| 371 | \method{get_timer()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 372 | \end{funcdesc} |
| 373 | \end{flushleft} |
| 374 | |
| 375 | Form objects have the following data attributes; see the FORMS |
| 376 | documentation: |
| 377 | |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 378 | \begin{tableiii}{|l|c|l|}{member}{Name}{Type}{Meaning} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 379 | \lineiii{window}{int (read-only)}{GL window id} |
| 380 | \lineiii{w}{float}{form width} |
| 381 | \lineiii{h}{float}{form height} |
| 382 | \lineiii{x}{float}{form x origin} |
| 383 | \lineiii{y}{float}{form y origin} |
| 384 | \lineiii{deactivated}{int}{nonzero if form is deactivated} |
| 385 | \lineiii{visible}{int}{nonzero if form is visible} |
| 386 | \lineiii{frozen}{int}{nonzero if form is frozen} |
| 387 | \lineiii{doublebuf}{int}{nonzero if double buffering on} |
| 388 | \end{tableiii} |
| 389 | |
Guido van Rossum | 470be14 | 1995-03-17 16:07:09 +0000 | [diff] [blame] | 390 | \subsection{FORMS Objects} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 391 | |
| 392 | Besides methods specific to particular kinds of FORMS objects, all |
| 393 | FORMS objects also have the following methods: |
| 394 | |
Fred Drake | 1947991 | 1998-02-13 06:58:54 +0000 | [diff] [blame] | 395 | \setindexsubitem{(FORMS object method)} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 396 | \begin{funcdesc}{set_call_back}{function\, argument} |
| 397 | Set the object's callback function and argument. When the object |
| 398 | needs interaction, the callback function will be called with two |
| 399 | arguments: the object, and the callback argument. (FORMS objects |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 400 | without a callback function are returned by \function{fl.do_forms()} |
| 401 | or \function{fl.check_forms()} when they need interaction.) Call this |
| 402 | method without arguments to remove the callback function. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 403 | \end{funcdesc} |
| 404 | |
| 405 | \begin{funcdesc}{delete_object}{} |
| 406 | Delete the object. |
| 407 | \end{funcdesc} |
| 408 | |
| 409 | \begin{funcdesc}{show_object}{} |
| 410 | Show the object. |
| 411 | \end{funcdesc} |
| 412 | |
| 413 | \begin{funcdesc}{hide_object}{} |
| 414 | Hide the object. |
| 415 | \end{funcdesc} |
| 416 | |
| 417 | \begin{funcdesc}{redraw_object}{} |
| 418 | Redraw the object. |
| 419 | \end{funcdesc} |
| 420 | |
| 421 | \begin{funcdesc}{freeze_object}{} |
| 422 | Freeze the object. |
| 423 | \end{funcdesc} |
| 424 | |
| 425 | \begin{funcdesc}{unfreeze_object}{} |
| 426 | Unfreeze the object. |
| 427 | \end{funcdesc} |
| 428 | |
| 429 | %\begin{funcdesc}{handle_object}{} XXX |
| 430 | %\end{funcdesc} |
| 431 | |
| 432 | %\begin{funcdesc}{handle_object_direct}{} XXX |
| 433 | %\end{funcdesc} |
| 434 | |
| 435 | FORMS objects have these data attributes; see the FORMS documentation: |
| 436 | |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 437 | \begin{tableiii}{|l|c|l|}{member}{Name}{Type}{Meaning} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 438 | \lineiii{objclass}{int (read-only)}{object class} |
| 439 | \lineiii{type}{int (read-only)}{object type} |
| 440 | \lineiii{boxtype}{int}{box type} |
| 441 | \lineiii{x}{float}{x origin} |
| 442 | \lineiii{y}{float}{y origin} |
| 443 | \lineiii{w}{float}{width} |
| 444 | \lineiii{h}{float}{height} |
| 445 | \lineiii{col1}{int}{primary color} |
| 446 | \lineiii{col2}{int}{secondary color} |
| 447 | \lineiii{align}{int}{alignment} |
| 448 | \lineiii{lcol}{int}{label color} |
| 449 | \lineiii{lsize}{float}{label font size} |
| 450 | \lineiii{label}{string}{label string} |
| 451 | \lineiii{lstyle}{int}{label style} |
| 452 | \lineiii{pushed}{int (read-only)}{(see FORMS docs)} |
| 453 | \lineiii{focus}{int (read-only)}{(see FORMS docs)} |
| 454 | \lineiii{belowmouse}{int (read-only)}{(see FORMS docs)} |
| 455 | \lineiii{frozen}{int (read-only)}{(see FORMS docs)} |
| 456 | \lineiii{active}{int (read-only)}{(see FORMS docs)} |
| 457 | \lineiii{input}{int (read-only)}{(see FORMS docs)} |
| 458 | \lineiii{visible}{int (read-only)}{(see FORMS docs)} |
| 459 | \lineiii{radio}{int (read-only)}{(see FORMS docs)} |
| 460 | \lineiii{automatic}{int (read-only)}{(see FORMS docs)} |
| 461 | \end{tableiii} |
| 462 | |
| 463 | \section{Standard Module \sectcode{FL}} |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 464 | \label{module-FLuppercase} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 465 | \stmodindex{FL} |
| 466 | |
| 467 | This module defines symbolic constants needed to use the built-in |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 468 | module \module{fl} (see above); they are equivalent to those defined in |
| 469 | the \C{} header file \code{<forms.h>} except that the name prefix |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 470 | \samp{FL_} is omitted. Read the module source for a complete list of |
| 471 | the defined names. Suggested use: |
| 472 | |
Fred Drake | 1947991 | 1998-02-13 06:58:54 +0000 | [diff] [blame] | 473 | \begin{verbatim} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 474 | import fl |
| 475 | from FL import * |
Fred Drake | 1947991 | 1998-02-13 06:58:54 +0000 | [diff] [blame] | 476 | \end{verbatim} |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 477 | |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 478 | \section{Standard Module \sectcode{flp}} |
Fred Drake | b215137 | 1998-01-14 05:47:15 +0000 | [diff] [blame] | 479 | \label{module-flp} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 480 | \stmodindex{flp} |
| 481 | |
| 482 | This module defines functions that can read form definitions created |
Fred Drake | 0cf0cfb | 1998-02-19 20:59:19 +0000 | [diff] [blame] | 483 | by the `form designer' (\program{fdesign}) program that comes with the |
| 484 | FORMS library (see module \module{fl} above). |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 485 | |
| 486 | For now, see the file \file{flp.doc} in the Python library source |
| 487 | directory for a description. |
| 488 | |
| 489 | XXX A complete description should be inserted here! |