Project 1 help session : FLTK and FLUID

This page is designed to assist you in completing project 1, Impressionist. This is the basic tutorial for using FLTK and FLUID to create the user interface.




FLTK tutorial

FLTK is a C++ graphical user interface tookit for X(Unix), OpenGL and Microsoft Windows(Nt 4.0, 95, 98).

We won't cover much about FLTK in here, since we will be using FLUID to generate the FLTK source code. But it is good to learn the basic of FLTK so that you can be more familiar with Fluid later on. You can click here to see the complete FLTK Programming Manual.

Naming

All public symbols in FLTK start with the charaters 'F' and 'L'

SimpleProgram

Here is a simple Hello World program that I get from the FLTK Programming Manual.
	#include <FL/Fl.h>
	#include <FL/Fl_Window.H>
	#include <FL/Fl_Box.h>

	int main(int argc, char *argv) {
	  FL_Window *window = new Fl_Window(300, 180);
	  FL_Box *box = new Fl_Box(20, 40, 260, 100, "Hello World!");
	  box->(FL_UP_BOX);
	  box->labelsize(36);
	  box->labelfont(FL_BOLD);
	  box->labeltype(FL_SHADOW_LABEL);
	  window->end();
	  window->show(argc, argv);
	  return Fl::run()
	}
The statement "FL_Window *window = ..." will create a window with the specified size(36). The next statement will create a box with the "Hello World!" string in it. To format the box and string, we can use "labelfont", "labeltype", etc.

FLUID tutorial

Fluid is a graphics editor that is used to produce FLTK source code.

The Simple Hello World program

We will try to create the simple Hello World program (the one in the FLTK tutorial above) using FLUID. Open the FLUID executable in the bin directory (in the lab it will be in d:/local/bin).
[PICTURE]

FLUID for Impressionist

Other widgets

Other widgets that we use in impressionist are: You can get more in depth with FLUID from FLTK Manual