2001-11-05 04:07:34 +03:00
|
|
|
<HTML>
|
|
|
|
<BODY>
|
2001-11-27 00:40:14 +03:00
|
|
|
|
2001-11-05 04:07:34 +03:00
|
|
|
<H1 ALIGN="RIGHT"><A NAME="intro">1 - Introduction to FLTK</A></H1>
|
|
|
|
|
|
|
|
<P>The Fast Light Tool Kit ("FLTK", pronounced
|
|
|
|
"fulltick") is a LGPL'd C++ graphical user interface
|
2002-03-24 20:26:00 +03:00
|
|
|
toolkit for X (UNIX®), MacOS®, and Microsoft®
|
|
|
|
Windows®. It was originally developed by Mr. Bill Spitzak
|
|
|
|
and is currently maintained by a small group of developers
|
|
|
|
across the world with a central repository in the US.</P>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
<H2>History of FLTK</H2>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
2001-11-27 00:40:14 +03:00
|
|
|
<P>It has always been Bill's belief that the GUI API of all
|
|
|
|
modern systems is much too high level. Toolkits (even FLTK) are
|
|
|
|
<I>not</I> what should be provided and documented as part of an
|
|
|
|
operating system. The system only has to provide arbitrary
|
|
|
|
shaped but featureless windows, a powerful set of graphics
|
|
|
|
drawing calls, and a simple <I>unalterable</I> method of
|
|
|
|
delivering events to the owners of the windows. NeXT (if you
|
2001-11-29 22:24:00 +03:00
|
|
|
ignored NextStep) provided this, but they chose to hide it and
|
2001-11-27 00:40:14 +03:00
|
|
|
tried to push their own baroque toolkit instead.</P>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<P>Many of the ideas in FLTK were developed on a NeXT (but
|
|
|
|
<I>not</I> using NextStep) in 1987 in a C toolkit Bill called
|
|
|
|
"views". Here he came up with passing events downward
|
|
|
|
in the tree and having the handle routine return a value
|
2001-11-27 00:40:14 +03:00
|
|
|
indicating the used the event, and the table-driven menus. In
|
2001-11-05 04:07:34 +03:00
|
|
|
general he was trying to prove that complex UI ideas could be
|
|
|
|
entirely implemented in a user space toolkit, with no knowledge
|
|
|
|
or support by the system.</P>
|
|
|
|
|
|
|
|
<P>After going to film school for a few years, Bill worked at
|
2001-11-27 00:40:14 +03:00
|
|
|
Sun Microsystems on the (doomed) NeWS project. Here he found an
|
|
|
|
even better and cleaner windowing system, and he reimplemented
|
|
|
|
"views" atop that. NeWS did have an unnecessarily
|
2001-11-05 04:07:34 +03:00
|
|
|
complex method of delivering events which hurt it. But the
|
|
|
|
designers did admit that perhaps the user could write just as
|
2001-11-27 00:40:14 +03:00
|
|
|
good of a button as they could, and officially exposed the lower
|
|
|
|
level interface.</P>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<P>With the death of NeWS Bill realized that he would have to
|
|
|
|
live with X. The biggest problem with X is the "window
|
|
|
|
manager", which means that the toolkit can no longer
|
|
|
|
control the window borders or drag the window around.</P>
|
|
|
|
|
|
|
|
<P>At Digital Domain Bill discovered another toolkit,
|
2001-11-27 00:40:14 +03:00
|
|
|
"Forms". Forms was similar to his work, but provided
|
2001-11-05 04:07:34 +03:00
|
|
|
many more widgets, since it was used in many real applications,
|
|
|
|
rather then as theoretical work. He decided to use Forms, except
|
|
|
|
he integrated his table-driven menus into it. Several very large
|
|
|
|
programs were created using this version of Forms.</P>
|
|
|
|
|
|
|
|
<P>The need to switch to OpenGL and GLX, portability, and a
|
2001-11-29 22:24:00 +03:00
|
|
|
desire to use C++ subclassing required a rewrite of Forms.
|
2001-11-05 04:07:34 +03:00
|
|
|
This produced the first version of FLTK. The conversion to C++
|
|
|
|
required so many changes it made it impossible to recompile any
|
|
|
|
Forms objects. Since it was incompatible anyway, Bill decided
|
|
|
|
to incorporate his older ideas as much as possible by
|
|
|
|
simplifying the lower level interface and the event passing
|
|
|
|
mechanisim.</P>
|
|
|
|
|
|
|
|
<P>Bill received permission to release it for free on the
|
|
|
|
Internet, with the GNU general public license. Response from
|
|
|
|
Internet users indicated that the Linux market dwarfed the SGI
|
|
|
|
and high-speed GL market, so he rewrote it to use X for all
|
|
|
|
drawing, greatly speeding it up on these machines. That is the
|
|
|
|
version you have now.</P>
|
|
|
|
|
|
|
|
<P>Digital Domain has since withdrawn support for FLTK. While
|
|
|
|
Bill is no longer able to actively develop it, he still
|
|
|
|
contributes to FLTK in his free time and is a part of the FLTK
|
|
|
|
development team.</P>
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
<H2>Features</H2>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<P>FLTK was designed to be statically linked. This was done by
|
|
|
|
splitting it into many small objects and designing it so that
|
|
|
|
functions that are not used do not have pointers to them in the
|
|
|
|
parts that are used, and thus do not get linked in. This allows
|
|
|
|
you to make an easy-to-install program or to modify FLTK to
|
|
|
|
the exact requirements of your application without worrying
|
|
|
|
about bloat. FLTK works fine as a shared library, though, and
|
|
|
|
is now included with several Linux distributions.</P>
|
|
|
|
|
|
|
|
<P>Here are some of the core features unique to FLTK:</P>
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
<UL>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<LI>sizeof(Fl_Widget) == 64 to 92.</LI>
|
|
|
|
|
|
|
|
<LI>The "core" (the "hello" program
|
|
|
|
compiled & linked with a static FLTK library using
|
|
|
|
gcc on a 486 and then stripped) is 114K.</LI>
|
|
|
|
|
|
|
|
<LI>The FLUID program (which includes every widget) is
|
|
|
|
538k.</LI>
|
|
|
|
|
2001-12-12 18:20:27 +03:00
|
|
|
<LI>Written directly atop core libraries (Xlib, WIN32 or
|
|
|
|
Carbon) for maximum speed, and carefully optimized for
|
|
|
|
code size and performance.</LI>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
2001-12-12 10:50:37 +03:00
|
|
|
<LI>Precise low-level compatability between the X11,
|
2001-12-12 18:20:27 +03:00
|
|
|
WIN32 and MacOS versions - only about 10% of the code is
|
2001-11-27 00:40:14 +03:00
|
|
|
different.</LI>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
2001-11-29 22:24:00 +03:00
|
|
|
<LI>Interactive user interface builder program. Output is
|
2001-11-05 04:07:34 +03:00
|
|
|
human-readable and editable C++ source code.</LI>
|
|
|
|
|
|
|
|
<LI>Support for overlay hardware, with emulation if none
|
|
|
|
is available.</LI>
|
|
|
|
|
|
|
|
<LI>Very small & fast portable 2-D drawing library
|
2001-12-12 18:20:27 +03:00
|
|
|
to hide Xlib, WIN32, or QuickDraw.</LI>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<LI>OpenGL/Mesa drawing area widget.</LI>
|
|
|
|
|
|
|
|
<LI>Support for OpenGL overlay hardware on both X11 and
|
|
|
|
WIN32, with emulation if none is available.</LI>
|
|
|
|
|
|
|
|
<LI>Text widgets with Emacs key bindings, X cut &
|
|
|
|
paste, and foreign letter compose!</LI>
|
|
|
|
|
|
|
|
<LI>Compatibility header file for the GLUT library.</LI>
|
|
|
|
|
|
|
|
<LI>Compatibility header file for the XForms library.</LI>
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
</UL>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
<H2>Licensing</H2>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<P>FLTK comes with complete free source code. FLTK is available
|
|
|
|
under the terms of the <A href="license.html">GNU Library
|
|
|
|
General Public License</A> with ammendments that allow for
|
|
|
|
static linking. Contrary to popular belief, it can be used in
|
|
|
|
commercial software - even Bill Gates could use it!</P>
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
<H2>What Does "FLTK" Mean?</H2>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<P>FLTK was originally designed to be compatible with the Forms
|
|
|
|
Library written for SGI machines. 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 was taken as the name of the library.
|
|
|
|
It is almost impossible to search for "FL" on the
|
2001-11-29 22:24:00 +03:00
|
|
|
Internet, due to the fact that it is also the abbreviation for
|
2001-11-05 04:07:34 +03:00
|
|
|
Florida. After much debating and searching for a new name for
|
|
|
|
the toolkit, which was already in use by several people, Bill
|
|
|
|
came up with "FLTK", including a bogus excuse that it
|
|
|
|
stands for "The Fast Light Toolkit".</P>
|
|
|
|
|
2001-12-11 19:03:13 +03:00
|
|
|
<H2>Building and Installing FLTK Under UNIX and MacOS X</H2>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<P>In most cases you can just type "make". This will
|
|
|
|
run configure with the default of no options and then compile
|
|
|
|
everything.</P>
|
|
|
|
|
|
|
|
<P>FLTK uses GNU autoconf to configure itself for your UNIX
|
|
|
|
platform. The main things that the configure script will look
|
2001-11-29 22:24:00 +03:00
|
|
|
for are the X11 and OpenGL (or Mesa) header and library files.
|
2001-11-05 04:07:34 +03:00
|
|
|
If these cannot be found in the standard include/library
|
|
|
|
locations you'll need to define the <tt>CFLAGS</tt>,
|
|
|
|
<tt>CXXFLAGS</tt>, and <tt>LDFLAGS</tt> environment variables.
|
|
|
|
For the Bourne and Korn shells you'd use:</P>
|
|
|
|
|
1999-01-27 00:36:02 +03:00
|
|
|
<UL><PRE>
|
|
|
|
CFLAGS=-I<I>includedir</I>; export CFLAGS
|
|
|
|
CXXFLAGS=-I<I>includedir</I>; export CXXFLAGS
|
|
|
|
LDFLAGS=-L<I>libdir</I>; export LDFLAGS
|
|
|
|
</PRE></UL>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<P>For C shell and tcsh, use:</P>
|
|
|
|
|
1999-01-27 00:36:02 +03:00
|
|
|
<UL><PRE>
|
|
|
|
setenv CFLAGS "-I<I>includedir</I>"
|
|
|
|
setenv CXXFLAGS "-I<I>includedir</I>"
|
|
|
|
setenv LDFLAGS "-L<I>libdir</I>"
|
|
|
|
</PRE></UL>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<P>By default configure will look for a C++ compiler named
|
|
|
|
<tt>CC</tt>, <tt>c++</tt>, <tt>g++</tt>, or <tt>gcc</tt> in that
|
|
|
|
order. To use another compiler you need to set the <tt>CXX</tt>
|
|
|
|
environment variable:</P>
|
|
|
|
|
1999-01-27 00:36:02 +03:00
|
|
|
<UL><PRE>
|
2001-11-05 04:07:34 +03:00
|
|
|
CXX=xlC; export CXX
|
1999-01-27 00:36:02 +03:00
|
|
|
setenv CXX "xlC"
|
|
|
|
</PRE></UL>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<P>The <tt>CC</tt> environment variable can also be used to
|
|
|
|
override the default C compiler (<tt>cc</tt> or <tt>gcc</tt>),
|
|
|
|
which is used for a few FLTK source files.</P>
|
|
|
|
|
|
|
|
<P>You can run configure yourself to get the exact setup you
|
|
|
|
need. Type "./configure <options>", where
|
|
|
|
options are:</P>
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
<DL>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
2002-04-10 20:26:33 +04:00
|
|
|
<DT>--enable-cygwin</DT>
|
|
|
|
<DD>Enable the Cygwin libraries under WIN32</DD>
|
|
|
|
|
2001-11-05 04:07:34 +03:00
|
|
|
<DT>--enable-debug</DT>
|
|
|
|
<DD>Enable debugging code & symbols</DD>
|
|
|
|
|
2002-04-10 20:26:33 +04:00
|
|
|
<DT>--disable-gl</DT>
|
|
|
|
<DD>Disable OpenGL support</DD>
|
|
|
|
|
2001-11-05 04:07:34 +03:00
|
|
|
<DT>--enable-shared</DT>
|
|
|
|
<DD>Enable generation of shared libraries</DD>
|
|
|
|
|
2002-04-10 20:26:33 +04:00
|
|
|
<DT>--enable-threads</DT>
|
|
|
|
<DD>Enable multithreading support</DD>
|
|
|
|
|
|
|
|
<DT>--enable-xdbe</DT>
|
|
|
|
<DD>Enable the X double-buffer extension</DD>
|
|
|
|
|
|
|
|
<DT>--enable-xft</DT>
|
|
|
|
<DD>Enable the Xft library for anti-aliased fonts under X11</DD>
|
|
|
|
|
2001-11-05 04:07:34 +03:00
|
|
|
<DT>--bindir=/path</DT>
|
|
|
|
<DD>Set the location for executables [default = $prefix/bin]</DD>
|
|
|
|
|
|
|
|
<DT>--datadir=/path</DT>
|
|
|
|
<DD>Set the location for data files. [default = $prefix/share]</DD>
|
|
|
|
|
|
|
|
<DT>--libdir=/path</DT>
|
|
|
|
<DD>Set the location for libraries [default = $prefix/lib]</DD>
|
|
|
|
|
|
|
|
<DT>--includedir=/path</DT>
|
|
|
|
<DD>Set the location for include files. [default = $prefix/include]</DD>
|
|
|
|
|
|
|
|
<DT>--mandir=/path</DT>
|
|
|
|
<DD>Set the location for man pages. [default = $prefix/man]</DD>
|
|
|
|
|
|
|
|
<DT>--prefix=/dir</DT>
|
|
|
|
<DD>Set the directory prefix for files [default = /usr/local]</DD>
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
</DL>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
|
|
|
<P>When the configure script is done you can just run the
|
|
|
|
"make" command. This will build the library, FLUID
|
|
|
|
tool, and all of the test programs.</P>
|
|
|
|
|
|
|
|
<P>To install the library, become root and type "make
|
|
|
|
install". This will copy the "fluid" executable
|
2001-11-29 22:24:00 +03:00
|
|
|
to "bindir", the header files to
|
2001-11-05 04:07:34 +03:00
|
|
|
"includedir", and the library files to
|
|
|
|
"libdir".</P>
|
|
|
|
|
1999-01-13 23:55:40 +03:00
|
|
|
<H2>Building FLTK Under Microsoft Windows</H2>
|
2001-11-05 04:07:34 +03:00
|
|
|
|
2001-11-29 22:24:00 +03:00
|
|
|
<P>There are three ways to build FLTK under Microsoft Windows.
|
2001-11-05 04:07:34 +03:00
|
|
|
The first is to use the Visual C++ 5.0 project files under the
|
|
|
|
"visualc" directory. Just open (or double-click on)
|
|
|
|
the "fltk.dsw" file to get the whole shebang.</P>
|
|
|
|
|
2001-11-27 00:40:14 +03:00
|
|
|
<P>The second method is to use the <TT>configure</TT> script
|
|
|
|
included with the FLTK software; this has only been tested with
|
|
|
|
the CygWin tools:</P>
|
|
|
|
|
|
|
|
<UL><PRE>
|
|
|
|
sh configure --prefix=C:/FLTK
|
|
|
|
make
|
|
|
|
</PRE></UL>
|
|
|
|
|
|
|
|
<P>The final method is to use a GNU-based development tool with
|
|
|
|
the files in the "makefiles" directory. To build
|
2001-11-05 04:07:34 +03:00
|
|
|
using one of these tools simply copy the appropriate
|
|
|
|
makeinclude and config files to the main directory and do a
|
|
|
|
make:</P>
|
|
|
|
|
|
|
|
<UL><PRE>
|
1999-02-18 17:11:45 +03:00
|
|
|
copy makefiles\Makefile.<env> Makefile
|
1998-12-29 17:21:17 +03:00
|
|
|
make
|
2001-11-05 04:07:34 +03:00
|
|
|
</PRE></UL>
|
|
|
|
|
1999-02-19 18:11:34 +03:00
|
|
|
<H3>Using the Visual C++ DLL Library</H3>
|
2001-11-27 00:40:14 +03:00
|
|
|
|
|
|
|
<P>The "fltkdll.dsp" project file builds a DLL-version
|
|
|
|
of the FLTK library. Because of name mangling differences
|
|
|
|
between PC compilers (even between different versions of Visual
|
|
|
|
C++!) you can only use the DLL that is generated with the same
|
|
|
|
version compiler that you built it with.</P>
|
|
|
|
|
|
|
|
<P>When compiling an application or DLL that uses the FLTK DLL,
|
|
|
|
you will need to define the <tt>FL_DLL</tt> preprocessor symbol
|
|
|
|
to get the correct linkage commands embedded within the FLTK
|
|
|
|
header files.</P>
|
2000-08-19 23:03:46 +04:00
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
<H2>Building FLTK Under OS/2</H2>
|
2000-08-19 23:03:46 +04:00
|
|
|
|
2001-11-27 00:40:14 +03:00
|
|
|
<P>The current OS/2 build requires XFree86 for OS/2 to work. A
|
|
|
|
native Presentation Manager version has not been implemented
|
|
|
|
yet (volunteers are welcome!).</P>
|
2000-08-19 23:03:46 +04:00
|
|
|
|
|
|
|
<p>The current set of Makefiles/configuration failes assumes that
|
|
|
|
EMX 0.9d and libExt
|
|
|
|
(from <A HREF="http://posix2.sourceforge.net">posix2.sourceforge.net</A>)
|
|
|
|
is installed.
|
|
|
|
|
2001-11-29 22:24:00 +03:00
|
|
|
<P>To build the XFree86 version of FLTK for OS/2, copy the appropriate
|
1999-01-13 22:28:54 +03:00
|
|
|
makeinclude and config files to the main directory and do a make: </P>
|
2000-08-19 23:03:46 +04:00
|
|
|
|
2001-11-27 00:40:14 +03:00
|
|
|
<UL><PRE>
|
1999-02-18 17:11:45 +03:00
|
|
|
copy makefiles\Makefile.os2x Makefile
|
1998-12-29 17:21:17 +03:00
|
|
|
make
|
2001-11-27 00:40:14 +03:00
|
|
|
</PRE></UL>
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
<H2>Internet Resources</H2>
|
2001-11-27 00:40:14 +03:00
|
|
|
|
|
|
|
<P>FLTK is available on the 'net in a bunch of locations:</P>
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
<DL>
|
2001-11-27 00:40:14 +03:00
|
|
|
|
2000-04-28 22:15:26 +04:00
|
|
|
<DT>WWW
|
2001-11-27 00:40:14 +03:00
|
|
|
<DD><A href="http://www.fltk.org/">http://www.fltk.org/</A>
|
2000-04-28 22:15:26 +04:00
|
|
|
|
|
|
|
<DT>FTP
|
|
|
|
<DD><A HREF="ftp://ftp.fltk.org/pub/fltk">California, USA (ftp.fltk.org)</A>
|
2000-06-06 01:21:24 +04:00
|
|
|
<DD><A HREF="ftp://ftp2.fltk.org/pub/fltk">Maryland, USA (ftp2.fltk.org)</A>
|
|
|
|
<DD><A HREF="ftp://ftp.funet.fi/pub/mirrors/ftp.fltk.org/pub/fltk">Espoo, Finland (ftp.funet.fi)</A>
|
2000-04-28 22:15:26 +04:00
|
|
|
<DD><A HREF="ftp://linux.mathematik.tu-darmstadt.de/pub/linux/mirrors/misc/fltk">Germany (linux.mathematik.tu-darmstadt.de)</A>
|
|
|
|
<DD><A HREF="ftp://gd.tuwien.ac.at/hci/fltk">Austria (gd.tuwien.ac.at)</A>
|
|
|
|
|
|
|
|
<DT>EMail</DT>
|
2001-11-29 22:24:00 +03:00
|
|
|
<DD><A href="mailto:fltk@fltk.org">fltk@fltk.org</A> [see
|
2000-04-28 22:15:26 +04:00
|
|
|
instructions below]
|
2001-11-29 22:24:00 +03:00
|
|
|
<DD><A href="mailto:fltk-bugs@fltk.org">fltk-bugs@fltk.org</A> [for
|
2000-04-28 22:15:26 +04:00
|
|
|
reporting bugs]
|
2001-11-27 00:40:14 +03:00
|
|
|
|
|
|
|
<DT>News</DT>
|
|
|
|
<DD><A HREF="news://news.easysw.com">news.easysw.com</A></DD>
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
</DL>
|
2001-11-27 00:40:14 +03:00
|
|
|
|
|
|
|
<P>To send a message to the FLTK mailing list
|
|
|
|
("fltk@fltk.org") you must first join the list.
|
|
|
|
Non-member submissions are blocked to avoid problems with
|
|
|
|
unsolicited email.</P>
|
|
|
|
|
2001-11-29 22:24:00 +03:00
|
|
|
<P>To join the FLTK mailing list, send a message to
|
2001-11-27 00:40:14 +03:00
|
|
|
"majordomo@fltk.org" with "subscribe fltk"
|
|
|
|
in the message body. A digest of this list is available by
|
|
|
|
subscribing to the "fltk-digest" mailing list.</P>
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
<H2>Reporting Bugs</H2>
|
2001-11-27 00:40:14 +03:00
|
|
|
|
|
|
|
<P>To report a bug in FLTK, send an email to
|
|
|
|
"fltk-bugs@fltk.org". Please include the FLTK version,
|
|
|
|
operating system & version, and compiler that you are using
|
|
|
|
when describing the bug or problem. We will be unable to provide
|
|
|
|
any kind of help without that basic information.</P>
|
|
|
|
|
|
|
|
<P>Bugs can also be reported to the "fltk.bugs" newsgroup or on the
|
|
|
|
SourceForge bug tracker pages.</P>
|
|
|
|
|
2001-11-29 22:24:00 +03:00
|
|
|
<P>For general support and questions, please use the FLTK mailing list
|
2001-11-27 00:40:14 +03:00
|
|
|
at "fltk@fltk.org" or one of the newsgroups.</P>
|
|
|
|
|
|
|
|
</BODY>
|
|
|
|
</HTML>
|