From b983b285cc4f0627a1f72c9d6c510047af0ad116 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 26 Jan 1999 21:36:02 +0000 Subject: Lots of documentation fixes, and added a new image for the Fluid chapter. git-svn-id: file:///fltk/svn/fltk/trunk@244 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/fluid.html | 471 ++++++++++++++++++++++++----------------------- 1 file changed, 239 insertions(+), 232 deletions(-) (limited to 'documentation/fluid.html') diff --git a/documentation/fluid.html b/documentation/fluid.html index fc6519cbd..c84d8fe52 100644 --- a/documentation/fluid.html +++ b/documentation/fluid.html @@ -3,39 +3,71 @@ This chapter shows how to use the Fast Light User-Interface Designer ("FLUID") to create your GUIs.

What is FLUID?

- The Fast Light User Interface Designer, or "FLUID", is a graphical + The Fast Light User Interface Designer, or FLUID, is a graphical editor that is used to produce FLTK source code. -

FLUID edits and saves its state in ".fl" files. These files are +

FLUID edits and saves its state in .fl files. These files are text, and you can (with care) edit them in a text editor, perhaps to get some special effects.

-

FLUID can "compile" the .fl file into a .cxx and a .h file. The -.cxx file defines all the objects from the .fl file and the .h file +

FLUID can "compile" the .fl file into a .cxx and a .h file. The +.cxx file defines all the objects from the .fl file and the .h file declares all the global ones.

A simple program can be made by putting all your code (including a -main() function) into the .fl file and thus making the .cxx file a +main() function) into the .fl file and thus making the .cxx file a single source file to compile. Most programs are more complex than -this, so you write other .cxx files that call the FLUID functions. - These .cxx files must #include the .h file or they can -#include the .cxx file so it still appears to be a single source +this, so you write other .cxx files that call the FLUID functions. + These .cxx files must #include the .h file or they can +#include the .cxx file so it still appears to be a single source file.

-

Normally the FLUID file defines one or more "functions", which -output C++ functions. Each function defines a one or more FLTK +

Normally the FLUID file defines one or more functions or classes which +output C++ code. Each function defines a one or more FLTK windows, and all the widgets that go inside those windows.

Widgets created by FLUID are either "named", "complex named" or "unnamed". A named widget has a legal C++ variable identifier as its name (i.e. only alphanumeric and underscore). In this case FLUID defines a global variable or class member that will point at the widget -after the function defining it is called. A "complex named" object has +after the function defining it is called. A complex named object has punctuation such as '.' or '->' or any other symbols in its name. In this case FLUID assigns a pointer to the widget to the name, but does not attempt to declare it. This can be used to get the widgets into -structures. An "unnamed" widget has a blank name and no pointer to -them is stored.

+structures. An unnamed widget has a blank name and no pointer is stored.

Widgets may either call a named callback function that you write in another source file, or you can supply a small piece of C++ source and -FLUID will write a private callback function into the .cxx file.

+FLUID will write a private callback function into the .cxx file.

+

Running FLUID Under UNIX

+ To run FLUID under UNIX, type: + +to edit the .fl file filename.fl. If the file does not exist +you will get an error pop-up, but if you dismiss it you will be editing +a blank file of that name. You can run FLUID without any name, in +which case you will be editing an unnamed blank setup (but you can use +save-as to write it to a file). +

You can provide any of the standard FLTK switches before the filename:

+ + Changing the colors may be useful to see what your interface will look +at if the user calls it with the same switches. +

In the current version, if you don't go into the background (with +'&' then you will be able to abort FLUID by typing ^C on the terminal. It +will exit immediately, losing any changes.

+

Running FLUID Under Microsoft Windows

+To run FLUID under WIN32, double-click on the fluid.exe file. +You can also run FLUID from the Command Prompt window (FLUID always +runs in the background under WIN32).

A Short Tutorial

  1. Type "FLUID"
  2. @@ -85,59 +117,24 @@ panel.
  3. Type "Alt+Q" to exit FLUID.
  4. Ok, now try to make a real program.
-

Running FLUID Under UNIX

- To run FLUID under UNIX, type: - - to edit the .fl file filename.fl. If the file does not exist -you will get an error pop-up, but if you dismiss it you will be editing -a blank file of that name. You can run FLUID without any name, in -which case you will be editing an unnamed blank setup (but you can use -save-as to write it to a file). -

You can provide any of the standard FLTK switches before the name:

- - Changing the colors may be useful to see what your interface will look -at if the user calls it with the same switches. -

In the current version, if you don't go into the background (with -'then you will be able to abort FLUID by typing ^C on the terminal. It -will exit immediately, losing any changes.

-

Running FLUID Under Microsoft Windows

- To run FLUID under windows, double-click on the fluid.exe file. -You can also run FLUID from the Command Prompt window (FLUID always -runs in the background). -

Compiling .fl files

+

Compiling .fl files

FLUID can also be called as a command-line "compiler" to create the -.cxx and .h file from a .fl file. To do this type: - - This will read the .fl file and write filename.cxx and +.cxx and .h file from a .fl file. To do this type: + +This will read the filename.fl file and write filename.cxx and filename.h. The directory will be stripped, so they are written to the current directory always. If there are any errors reading or writing the files it will print the error and exit with a non-zero -code. In a makefile you can use a line like this: work: +code. In a makefile you can use a line like this: - Some versions of make will accept rules like this to allow all .fl + Some versions of make will accept rules like this to allow all .fl files found to be compiled: