Global Special Event Handlers

The global special event handlers implement specific global interpreter features.

They must be defined in the startup class as static public methods to be taken into account.

Native global event handlers

Application_Error

Public Sub Application_Error()

Sinds 3.5

This handler is called when an error is raised and is not handled by any CATCH, TRY or FINALLY instruction.

Application_Log

Public Sub Application_Log(Text As String, Where As String)

Sinds 3.19

This handler intercepts each call to the ERROR or DEBUG instruction.

  • Text is the text printed by the entire instruction line.

  • Where is what Debug prints before the text. It is void when the Error instruction is used.

If the standard error output is redirected by ERROR TO, Application_Log will not catch the printed text.

Application_Read

Public Sub Application_Read()

Catches data sent to the standard input.

When this special event handler is defined, the standard input is watched by the interpreter, and the method is called each time there is something to read on the standard input.

Signal management event handlers

Application_Signal

Static Public Sub Application_Signal ( Signal As Integer )

This handler is called when a specific signal is caught.

See the gb.signal component documentation.

GUI global event handlers

These events handlers are available only when a GUI component is used.

Application_Change

Public Sub Application_Change()

Sinds 3.20

This handler is called to indicate a change in the desktop configuration.

To know which change occurred, you have to read the Application.Change property. It can take one of the following values:

"font" The desktop font has changed.
"color" The desktop color theme has changed.
"animation" The Application.Animations property has changed.
"shadow" The Application.Shadows property has changed.
"theme" The Application.Theme property has changed.

Application_KeyPress

Public Sub Application_KeyPress()

This handler is defined by GUI components. It intercepts every key press sent to the application.

If you stop the event, the key press will be ignored.