The Close Action

In Genero applications, when the user clicks the "X" button in the upper-right corner of the application window, a predefined close action is sent to the program. What happens next depends on the interactive dialog statement.

  • When the program is in a MENU dialog statement, the close action is converted to an INTERRUPT key press. If there is a COMMAND KEY INTERRUPT block in the MENU statement, the statements in that control block are executed. Otherwise, no action is taken.
  • When the program is in an INPUT, INPUT ARRAY, CONSTRUCT or DISPLAY ARRAY statement, the close action cancels the dialog, and the int_flag is set to TRUE. Your program can check the value of int_flag and take appropriate action.
You can change this default behavior by overwriting the close action within the interactive statement, by defining an ON ACTION close control block:
MENU
  ...
  ON ACTION close
    EXIT MENU
END MENU

By default the action view for the close action is hidden and does not display on the form, because The "X" button of the window is considered as an explicit action view.