Graphical mode rendering (GUI mode)

What is the graphical mode (GUI)?

Genero supports the Graphical User Interface (GUI) mode to display application windows and forms with a real graphical look and feel, for desktop workstation, web browsers and mobile front-end platforms.

The graphical mode is the default with Genero. The FGLGUI environment variable can be set to 0 (zero) to run the application in text mode.

Figure: Graphical rendering window example

Universal rendering screenshot

Form specification files for GUI mode

When designing a .per form file, use a LAYOUT section to define the layout of the form:
SCHEMA stores
LAYOUT
...
END
ATTRIBUTES
...
END

Forms defined with the SCREEN layout section can be displayed in GUI mode. However, to benefit from Genero BDL graphical enhancements, use a LAYOUT section.

Defining the target front-end

In graphical mode, the application forms are displayed on the front-end workstation identified with the FGLSERVER environment variable.

If this variable is not defined, the runtime system (fglrun) assumes that the front-end executes on the same computer.

Traditional GUI mode

To simplify migration from text mode to graphical mode with legacy applications, Genero supports the Traditional GUI mode option to render all application windows in a single front-end GUI window.

Checking for graphical mode in programs

In the program code, use the ui.Interface.getFrontEndName() method to query for the front-end type.

When this method return a value different from "console", the program executes in graphical mode.

Defining the GBC to be used in direct mode

In direct mode, it is possible to configure which GBC version has to be transmitted by the runtime system to the front-end.

The GBC component files must be located on the computer where the fglrun program executes, and will be transferred when the application starts.

The GBC component will be searched in the following directories:
  1. The appdir/gbc directory, where appdir is the directory where the program file is located,
  2. The directory defined in the FGLGBCDIR environment variable,
  3. The $FGLDIR/web_utilities/gbc/gbc directory.
If defined, make sure that FGLGBCDIR is set to a directory containing the GBC component files.
Note: The FGLGBCDIR environment variable is provided to select a given GBC in a development context when using the GUI direct mode. Do not use FGLGBCDIR in a production context: If a specific GBC is needed in production, consider shipping it in appdir/gbc. Otherwise, use the GBC available by default.
Tip: Set the FGLGUIDEBUG environment variable, to enable GUI protocol debug logging and verify which GBC is transmitted to the front-end by the runtime system. Search for log lines like:
*** uic_FT_processGet.1188: requestedName=gbc://index.html realName=/app/gbc/index.html

Defining the GBC to be used with the GAS

When executing applications through the Genero Application Server, displaying on the GDC, GMA or GMI front-ends, the GBC component files are found with the mechanism available in the GAS.

The $APPDIR/gbc directory is the recommended location for a production environment, when a specific GBC is required (typically, when using GBC customization).

Otherwise, if no specific GBC is required, the default GBC set in the GAS configuration will be used.

Building mobile apps with a specific GBC

When building a GMA or GMI app, the GBC component needs to be bundled with the app package.

The gmabuildtool and gmibuildtool commands support an option to specify the GBC to be bundled with the app.

For more details, see Building Android apps with Genero, Building iOS apps with Genero.