Text mode rendering (TUI mode)

What is the text mode (TUI)?

The text user interface (TUI) has been designed for character-based terminals. This mode can be used to run your application on a text terminal hardware or in a terminal emulator.

By default, Genero uses the Graphical mode. In order to run a Genero program on text mode, set the FGLGUI environment variable to 0 (zero).

On UNIX™ platforms, you need to configure your terminal capabilities with the TERM, TERMINFO or TERMCAP environment variables.

In TUI mode, all application forms will display within the current terminal device or emulator as shown.

Figure: Text mode console example

Text mode rendering screenshot

Form specification files for TUI mode

When designing a .per form file, use a SCREEN section to define the layout of the form:
SCREEN
{
---------------------------------------------------
                   Customer form
---------------------------------------------------
 Name: [f1                            ] Id:[f2   ]
 Phone:   [f3                         ]
 Address: [f4                                    ]
          [f4                                    ]
 City:    [f5                                    ]
 Zipcode: [f6       ] State: [f7           ]
---------------------------------------------------
}
END
ATTRIBUTES
f1 = FORMONLY.cust_name;
f2 = FORMONLY.cust_id, NOENTRY;
f3 = FORMONLY.cust_phone;
f4 = FORMONLY.cust_addr;
f5 = FORMONLY.cust_city;
f6 = FORMONLY.cust_zipcode;
f7 = FORMONLY.cust_state;
END

Using a LAYOUT section is for GUI mode only. When displaying a form defined with LAYOUT section in TUI mode (FGLGUI=0), the runtime system will raise the error -6315.

Checking for text mode in programs

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

When this method returns "console", the program executes in text mode.