Refreshing the user interface
Genero BDL only refreshes the user interface when the runtime waits for user interaction. In certain scenarios, this can result in information displayed in an I4GL application not being displayed when running as a Genero BDL application.
To optimize the display, the Genero runtime system only refreshes the screen when the user gets the control back. In other words, when an interactive instruction (a dialog) waits for a user interaction.
"Please
wait..."
message, displayed just before a lengthy processing.IBM® Informix® 4GL behavior
IBM Informix 4GL (I4GL) only supports a TUI mode, displaying screens on dumb terminal or terminal emulators.
When a program executes an instruction displaying information to the user, IBM Informix 4GL refreshes the screen immediately.
DISPLAY ... AT
instructions in a loop, I4GL
will show screen changes for each DISPLAY
instruction:MAIN
DEFINE i INTEGER
MENU "Test"
COMMAND "Start"
FOR i=1 TO 50000
DISPLAY i AT 5,5
END FOR
COMMAND "Quit"
EXIT MENU
END MENU
END MAIN
Genero BDL in TUI mode
The application runs in text (TUI) mode when FGLGUI=0. This section refers to an application running in TUI mode.
With the above code running in TUI mode, the screen will not show the numbers. It will only show
the final number, when the MENU
gives the control back to the user.
ui.Interface.refresh()
API
call.MAIN
DEFINE i INTEGER
MENU "Test"
COMMAND "Start"
FOR i=1 TO 50000
DISPLAY i AT 5,5
CALL ui.Interface.refresh()
END FOR
COMMAND "Quit"
EXIT MENU
END MENU
END MAIN
Genero BDL in GUI mode
When using the GUI mode of Genero, instead of displaying directly to the terminal screen, the runtime system communicates with a front-end. See The dynamic user interface for more details.
With GUI mode, if the program refreshes the user interface too often, it will produce a lot of unnecessary network traffic. The user interface should be refreshed periodically rather than continuously, to avoid network clogging.
In the following code example, we have added the (i MOD 100)==0
test to reduce
the number of refresh calls.
MAIN
DEFINE i INTEGER
MENU "Test"
COMMAND "Start"
FOR i=1 TO 5000000
IF (i MOD 100) == 0 THEN
DISPLAY i AT 5,5
CALL ui.Interface.refresh()
END IF
END FOR
COMMAND "Quit"
EXIT MENU
END MENU
END MAIN
ui.Interface.refresh()
to update the display of messages like
"Please wait..."
before a lengthy processing.