## class fltk::Free

### Class Hierarchy

    fltk::Widget
       |
       +----fltk::Free

### Include Files

    #include <fltk/Free.h>

### Description

Emulation of the Forms "free" widget. This emulation allows the free demo to run, and appears to be useful for porting programs written in Forms which use the free widget or make subclasses of the Forms widgets.

There are five types of free, which determine when the handle function is called:

    #define fltk::NORMAL_FREE		1
    #define fltk::SLEEPING_FREE	2
    #define fltk::INPUT_FREE		3
    #define fltk::CONTINUOUS_FREE	4
    #define fltk::ALL_FREE		5

An fltk::INPUT_FREE accepts fltk::FOCUS events. A fltk::CONTINUOUS_FREE sets a timeout callback 100 times a second and provides a fltk::STEP event, this has obvious detrimental effects on machine performance. fltk::ALL_FREE does both. fltk::SLEEPING_FREE are deactivated.

### Methods

- fltk::Free
- ~Free

#### fltk::Free(uchar type, int, int, int, int, const char*l, fltk::HANDLEPTR hdl)

The constructor takes both the `type` and the `handle` function. The handle function should be declared as follows:

    int
    handle_function(fltk::Widget *w,
                    int       event,
    	        float     event_x,
    		float     event_y,
    		char      key)

This function is called from the the `handle()` method in response to most events, and is called by the `draw()` method. The `event` argument contains the event type:

    // old event names for compatability:
    #define fltk::MOUSE		fltk::DRAG
    #define fltk::DRAW			0
    #define fltk::STEP			9
    #define fltk::FREEMEM		12
    #define fltk::FREEZE		fltk::HIDE
    #define fltk::THAW			fltk::SHOW

#### virtual fltk::Free::~Free()

The destructor will call the handle function with the event `fltk::FREE_MEM`.