Who is this website for?
Why use FLTK?
Getting the Software
Goto FLTK Basics
Flash video !
Simple Window Function
Widget Label Pitfall (NEW)
Simple Window with widgets that talk to each other
Two widgets talking (NEW)
Simple Inherited Window
More sections to come in the future
NewsDate: Jan 4/05
This tutorial has been updated. Cleaned up code and explanations in all sections. More examples and screenshots. Updated to match FLTK roadmap. New Sections: Widget Label Pitfall, Two widgets Talking.
Under construction: Events, Layouts, Browser, Makefiles
Date: Jan 1/05
Released Fl_RPNCalc version 1.1
Date: Sept 7/04
Check out my latest contribution. Fl_RPNCalc 1.0 is asimple RPN Calculator with keyboard numpad functionality.
Who is this website for?
This website is for C++ programmers who wish to start coding GUI (Graphical User Interface) applications using FLTK. The documentation of FLTK is very good. However, I found the tutorial examples went from very easy (Hello World) to a little too diffucult (editor.cxx). So this site is intended as afollow up to FLTK Basics. However, there is new documentation for FLTK 2.0 (Beta) which is also an excellent resource. It is my hope that when you finish this tutorial you will be able to code your own FLTK applications with pleasure. O
I assume you already have somewhat of a foundation in C++ programming. Most importantly you need to understand classes,inheritance, pointers and dynamic memory allocation before you can attempt to learn GUI programming.
Here are some C++ tutorial sites:
Thinking In C++ 2nd Edition by Bruce Eckel (Free Online Book)
Why use FLTK as opposed to other GUI toolkits?
- it's Free Open Source Software under the GNU LGPL. See the FLTK license agreement for more details
- it's efficient and straightforward
- it uses C++
- it makes small statically linked stand alone executables that are fast
- it's cross platform with Linux/Unix, Windows and MacOSX (write once compile anywhere)
- it supports OpenGL
- it has a graphical user interface builder called FLUID
- it's fun and easy to learn
- Download FLTK software from www.fltk.org (get latest stable version 1.1.x)
- Install it with the following commands in a console
tar -xvzf fltk-1.1.6-source.tar.gz
Note: if you download the .tar.bz2 file use -xvjf instead of -xvzf
Linux has lots and lots ofwonderful text editors and IDE's. I personally like Anjuta and gedit.
"#make install" will put files in /usr/local/ and its subdirectories.
Also, you need the X development libraries on your system. If you don't, ./configure will fail. Most linux distros come with X development libraries installed by default.
Windows Install:Option 1
- Get the latest version of (Dev-C++ with MinGW) from http://www.bloodshed.net
- Then use the update feature to get the FLTK Devpak (get the latest 1.1.x)
- Or Download DevPak FLTK1 from FLTK.net
- If this DevPak from fltk.net does not work properly try the older one below.
- The older one is 1.1.4 from this sourceforge server
- FLTK2 Devpak is for version 2.0. Although it'salready pretty stable this tutorial is about 1.1.x.
-Then create a new FLTK gui project. You should automatically have the "Hello World" code.
- Download FLTK software from www.fltk.org
- Get the latest MinGW, MSYS and msysDTK executable install files from here at sourceforge
1) MinGW-3.x.x-x.exe (32 bit Windows)
2) MSYS-1.x.x.exe (32 bit Windows)