A short tutorial on how to use FLUID

 

Start with creating a new fluid file and give a name such as gui.fl to it.

To the empty file add a function.

Provide a name to the function say "createGUI() with the arguments argc and argv. Set the return type to 'int' otherwise it will return the window itself.

Now add a window to the function.

Interactively resize the window so that you can fit all the widgets in it. Select the type of window to be "Double". Give a name to the window say "winProg2". In the extra code part add the lines as shown. This will tell the underlying window manager to use double buffering while rendering this window. The second line displays the window.

In order to create the openGL window first we need to add a box (new->other->box). Then in the properties for the box set the class of the box to "Court" (or any other name that you have used for defining your opengl class. In the name add the name of the object you wish to refer it as for example "objCourt". In the extra code part include the header that provides the class definition. Now this will tell FLTK that this is not an ordinary box.

 

Now lets add a box for enclsoing the sliders. Create a box as above and set the box type to some value say "Engraved box". Provide appropriate label.

 

Now add a slider (value_slider). Give an appropriate name for the slider.

 

For the callback here we just put a printf statement. However you will replace it your code.

Add a exit button and label it and define the callback as shown.

 

Similarly add other widgets finally save your fl file. The write the source and header files.