Fl_Widget(x, y, width, height, label)
label is a pointer to a character string to label the widget with or NULL. If not specified the label defaults to NULL. The label string must be in static storage such as a string constant because FLTK does not make a copy of it - it just uses the pointer.
Widgets are commonly ordered into functional groups, which in turn may be grouped again, creating a hierarchy of widgets. FLTK makes it easy to fill groups by automatically adding all widgets that are created between a myGroup->begin() and myGroup->end(). In this example, myGroup would be the current group.
Newly created groups and their derived widgets implicitly call begin() in the constructor, effectively adding all subsequently created widgets to itself until end() is called.
FLTK uses method name overloading to make short names for get/set methods. A "set" method is always of the form "void name(type)", and a "get" method is always of the form "type name() const".
Almost all of the set/get pairs are very fast, short inline functions and thus very efficient. However, the "set" methods do not call redraw() - you have to call it yourself. This greatly reduces code size and execution time. The only common exceptions are value() which calls redraw() and label() which calls redraw_label() if necessary.
If you change a widget’s size or position after it is displayed you will have to call redraw() on the widget’s parent.
button->position(x, y);
group->resize(x, y, width, height);
window->size(width, height);
The show() method shows the widget or window.
FLTK also supports idle, timer, and file pseudo-events that cause a function to be called when they occur.
File functions are called when data is ready to read or write, or when an error condition occurs on a file. They are most often used to monitor network connections (sockets) for data-driven displays.
Fl::add_fd
Fl::add_timeout
...