Next: , Up: Part I Defining Forms   [Contents][Index]


3.1 Starting and Ending a Form Definition

A form consists of a collection of objects. A form definition is started with the routine

FL_FORM *fl_bgn_form(int type, FL_Coord w, FL_Coord h);

w and h indicate the width and height of the form (in pixels by default). Positions in the form will be indicated by integers between 0 and w-1 or h-1. The actual size of the form when displayed on the screen can still be varied. type indicates the type of the background drawn in the form. The background of each form is a box. See the next section for the different types available. The routine returns a pointer to the form just defined. This pointer must be used, for example, when drawing the form or doing interaction with it. The form definition ends with

void fl_end_form(void);

Between these two calls objects are added to the form. The following sections describe some of the more common classes of objects that can be added to a form.

there’s no built-in upper limit on the number of forms that can be defined and displayed when required. Normally you probably will first define all your forms before starting the actual work but it’s no problem to define new forms also later on.