Jump to content

FLTK: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
1.3.x: The old text read as if it were written before any releases were made.
Line 101: Line 101:


===1.4.x===
===1.4.x===
Adds even more features to 1.3.
Adds even more features to 1.3. Not active at present.


===3.0 branch===
===3.0 branch===

Revision as of 21:18, 9 May 2014

FLTK
Initial release1998
Stable release1.3.9 (December 9, 2023; 11 months ago (2023-12-09)[1]) [±]
Preview releaseexperimental-2022-01 (January 23, 2022; 2 years ago (2022-01-23)) [±]
Repository
Written inC++
Operating systemUnix-like with X11, OS X, Windows, AmigaOS 4
TypeWidget toolkit
LicenseGNU Lesser General Public License[2] (with an exception to allow static linking)
Websitewww.fltk.org

The Fast, Light Toolkit (FLTK, pronounced fulltick)[3] is a cross-platform graphical user interface (GUI) library 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 (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 and open-source software, licensed under GNU Lesser General Public License (LGPL) with an additional clause permitting static linking from applications with incompatible licenses.

In contrast to GUI widget 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 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.[citation needed]

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 name

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".[4]

Architecture

FLTK is an object-oriented widget toolkit written in the C programming language; it uses the GLib object system for the object orientation. While GTK+ is primarily targeted at the X Window System, it works on other platforms, including Microsoft Windows (interfaced with the Windows API), and Mac OS X (interfaced with Quartz). HTML5 and Wayland backends are in development.

GTK+ can be configured to change the look of the widgets drawn; this is done using different display engines. Several display engines exist which try to emulate the look of the native widgets on the platform in use.

Language bindings

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

FLTK was primarily designed for, and is written in, the programming language C++. However, bindings exist for other languages, for example Perl,[6] Python,[7] Lua,[8] Ruby [9] and Tcl.[10]

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();
}

GUI designers

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

Usage

See Category:Software that uses FLTK

Versions

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

1.0.x

This is a previous stable version, no longer maintained.

1.1.x

This is a previous stable version, no longer 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

Current stable development branch. Provides UTF-8 support.

1.4.x

Adds even more features to 1.3. Not active at present.

3.0 branch

This branch is mostly a conceptual model for future work.

See also

References

  1. ^ https://www.fltk.org/articles.php?L1898
  2. ^ FLTK License Agreement
  3. ^ FLTK home
  4. ^ http://www.fltk.org/articles.php?L363+I0+TFAQ+P1+Q
  5. ^ GTK+ Language Bindings
  6. ^ http://www.fltk.org/wiki.php?LC+P139+TC+Q
  7. ^ pyFLTK homepage
  8. ^ murgaLua homepage
  9. ^ Ruby/FLTK homepage
  10. ^ Tcl/Fltk homepage
  11. ^ What are the Versions of FLTK?, retrieved 2010-07-23