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).
Important: 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.
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
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.