Template:Short description {{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1 | unknown = Template:Main other | preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y | AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid }}Template:Main other

Fast Light Toolkit (FLTK)<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> is a cross-platform widget (graphical control element) library for graphical user interfaces (GUIs), developed by Bill Spitzak and others. Made to accommodate 3D graphics programming, it has an interface to OpenGL, but it is also suitable for general GUI programming.

Using its own widget, drawing and event systems abstracted from the underlying system-dependent code, it allows for writing programs which look the same on all supported operating systems.

FLTK is free and open-source software, licensed under GNU Lesser General Public License (LGPL) with an added clause permitting static linking from applications with incompatible licenses.

In contrast to user interface libraries like GTK, 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 complex macros, separate code preprocessors, and use of some advanced C++ features: templates, exceptions, and run-time type information (RTTI) or, for FLTK 1.x, namespaces. Combined with the modest size of the package, this makes it relatively easy to learn for new users.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

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.

Meaning of the nameEdit

FLTK was originally designed to be compatible with the Forms Library written for Silicon Graphics (SGI) machines (a derivative of this library called XForms is still used quite often). In that library, all functions and structures start 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 that searching "FL" on the Internet was a problem, because 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 Fast Light Tool Kit (FLTK).<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

ArchitectureEdit

FLTK is an object-oriented widget toolkit written in the programming language C++. While GTK is mainly optimized for the X Window System, FLTK works on other platforms, including Microsoft Windows (interfaced with the Windows API), and OS X (interfaced with Quartz). A Wayland back-end has been implemented and is available since release 1.4.0.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> FLTK2 has gained experimental support for optionally using the cairo graphics library.

Language bindingsEdit

A library written in one programming language may be used in another language if language bindings are written. FLTK has a range of bindings for various languages.

FLTK was mainly designed for, and is written in, the programming language C++. However, bindings exist for other languages, for example Lua,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Perl,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Python,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Ruby,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Rust<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> and Tcl.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

For FLTK 1.x, this example creates a window with an Okay button: <syntaxhighlight lang="cpp">

  1. include <FL/Fl.H>
  2. include <FL/Fl_Window.H>
  3. 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();

} </syntaxhighlight>

GUI designersEdit

FLTK includes Fast Light User Interface Designer (FLUID), a graphical GUI designer that generates C++ source and header files.

UseEdit

Template:See also

Many programs and projects use FLTK, including:

  • Nanolinux, 14 MB Linux distribution<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref name="auto1">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref name="auto2">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref name="auto">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

  • XFDOS, a FreeDOS-based distribution with a GUI, porting Nano-X and FLTK<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref><ref name="auto1"/><ref name="auto2"/><ref name="auto"/>

|CitationClass=web }}</ref>

  • Audio:
    • Fldigi, amateur radio software, allows data transmission and text chat via digital modes such as PSK31
    • Giada, looper, micro-sequencer, sample player software, open-source<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

    • Prodatum, synthesizer preset editor, uses a lifelike interface design<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

|CitationClass=web }}</ref>

  • Engineering:
    • ForcePAD, an intuitive tool to visualise the behavior of structures subject to loading and boundary conditions<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

    • Gmsh, an open-source finite element mesh generator
    • RoboCIM, software to simulate and control operation of a servo robot system and external devices<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

|CitationClass=web }}</ref>

  • Graphics:
    • CinePaint, deep-paint software, migrating from GTK to FLTK, open-source
    • ITK-SNAP, software application for medical image segmentation, open-source
    • Nuke, a digital compositing program. Until version 5, now replaced by Qt
    • Open Movie Editor<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

    • OpenVSP, an open-source NASA parametric 3D CAD for aircraft design and analysing<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

    • PosteRazor, open-source poster printing software for Windows, OS X, Linux<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

    • Tilemap Studio, An open-source tilemap editor for Game Boy, Color, Advance, DS, and SNES projects<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • SmallBASIC, Windows port
  • Web browsers:
    • Dillo, Dillo-2 was based on FLTK-2, abandoning this FLTK branch, with no official release, was a major cause of Dillo-3 being started, using FLTK1.3
    • Fifth, replicates functioning of early Opera<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

    • NetRider<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • Brain Visualizer: An open-source interactive visualizer for large-scale 3D brain models. Part of the Brain Organization Simulation System (BOSS) developed at Stony Brook University<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

VersionsEdit

Template:Expand section

This version history is an example of the sometimes tumultuous nature of open-source development.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

1.0.xEdit

This is a prior stable version, now unmaintained.

1.1.xEdit

This is a prior stable version, now unmaintained.

2.0 branchEdit

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. The branch is inactive now.

1.2.xEdit

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. All of its features have been incorporated in branch 1.3.

1.3.xEdit

Previous stable release.<ref name="auto3">https://www.fltk.org/articles.php?L825 Template:Webarchive Taken 5 March 2017.</ref> Provides UTF-8 support.

1.4.xEdit

Current stable branch. Adds more features to 1.3.<ref name="auto3"/> This branch is in maintenance mode since release 1.4.2 (Feb. 23, 2025).

1.5.xEdit

Current development branch. This branch is in early development stage. Since FLTK 1.5 CMake is required to build FLTK (configure/Makefile support has been dropped).

3.0 branchEdit

This branch resulted from a vision to "unfork" branches 1.x and 2.0, but it was never completed. All efforts to develop this branch have been abandoned. Now inactive.

See alsoEdit

Template:Portal

ReferencesEdit

Template:Reflist

External linksEdit

Template:Widget toolkits