FLTK

FLTK
Initial release 1998
Stable release 1.3.0  (June 16, 2011; 7 months ago (2011-06-16)) [±]
Preview release v2.0.x-r7513 [±]
Written in C++
Operating system Unix/Linux/BSD (X11), Mac OS X, Windows, AmigaOS 4.0
Type Widget toolkit
License GNU Lesser General Public License (with an exception that allows static linking)
Website http://www.fltk.org/

FLTK (the Fast, Light Toolkit, pronounced "fulltick")[1] is a cross-platform GUI library developed by Bill Spitzak and others. Made with 3D graphics programming in mind, it has an interface to OpenGL, but it is also suitable for general GUI programming.

Using its own widget, drawing and event systems (though FLTK2 has gained experimental support for optionally using the cairo graphics library) abstracted from the underlying system-dependent code, it allows for writing programs which look the same on all supported operating systems.

FLTK is free software, licensed under LGPL with an additional clause permitting static linking from applications with incompatible licenses. It includes FLUID (FLTK User Interface Designer), a graphical GUI designer that generates C++ source and header files.

In contrast to libraries like Qt and wxWidgets, FLTK uses a more lightweight design and restricts itself to GUI functionality. Because of this, the library is very small (the FLTK "Hello World" program is around 100 KiB), and is usually statically linked. It also avoids complicated macros and separate code preprocessors, and does not use the following advanced C++ features: templates, exceptions, RTTI or, for FLTK 1.x, namespaces. Combined with the modest size of the package, this leads to a relatively short learning curve for new users.

These advantages come with corresponding disadvantages. FLTK offers fewer widgets than most GUI toolkits and, because of its use of non-native widgets, does not have native look-and-feel on any platform.

Contents

What Does "FLTK" Mean?

FLTK was originally designed to be compatible with the Forms Library written for SGI machines (a derivative of this library called "XForms" is still used quite often). In that library all the functions and structures started with "fl_". This naming was extended to all new methods and widgets in the C++ library, and this prefix "FL" was taken as the name of the library. After FL was released as open source, it was discovered it was impossible to search "FL" on the Internet, due to the fact that it is also the abbreviation for Florida. After much debating and searching for a new name for the toolkit, which was already in use by several people, Bill Spitzak came up with "FLTK", which stands for the "Fast Light Tool Kit".[2]

Using FLTK in programming languages

FLTK was primarily designed for, and is written in, the C++ programming language. However, bindings exist for other languages, for example Python,[3] Lua[4] and Ruby.[5]

The following example for FLTK 1.x creates a window with an "Okay" button:

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
 
int main(int argc, char *argv[]) {
   Fl_Window* w = new Fl_Window(330, 190);
   new Fl_Button(110, 130, 100, 35, "Okay");
   w->end();
   w->show(argc, argv);
   return Fl::run();
}

Software built on FLTK

Versions

The version history shows some of the tumultuous nature of open source development.[6]

1.0.x

This is a previous stable version, no longer maintained.

1.1.x

This is the long-established and stable version, currently maintained.

2.0 branch

This was a development branch, long thought to be the next step in FLTK's evolution, with many new features and a cleaner programming style. It never achieved stability, and development has largely ceased.

1.2.x

This was an attempt to take some of the best features of 2.0 and merge them back into the more popular 1.1 branch. It is no longer developed.

1.3.x

This is where active development on the next major edition of FLTK is taking place. It is somewhat less ambitious than 2.0 was, more like 1.1 but still willing to break APIs to add new features.

3.0 branch

This branch is mostly a conceptual model for future work.

See also

References

External links