Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Components
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
Language Index
Language Overviews
Arithmetical Functions
Arithmetic Operators
Array Declaration
Assignment Operators
Assignments
Binary Data Representation
Bits Manipulation Functions
Character Test Functions
Comparison methods
Complex numbers
Constant Declaration
Constant Expression
Conversion Functions
Datatype Functions
Datatypes
Date & Time Functions
Enumeration declaration
Error Management
Event Loop
Event Management
Events declaration
Expressions
External Function Management
File & Directory Functions
File & Directory Paths
File mode syntax
Floating Point Numbers
Formatting functions
Gambas Object Model
Global Special Event Handlers
Integer numbers
Intrinsic Functions
Language Constants
Localization and Translation Functions
Local Variable Declaration
Logarithms & Exponentials Functions
Logical Operators
Loop Control Structures
Method Declaration
Miscellaneous Control Structures
Miscellaneous Functions
Native Arrays
Native Container Classes
Object & Class Management
Operator Evaluation Order
Predefined Constants
Process Management
Property Declaration
Random Numbers Functions
Special Methods
Stream & Input/Output functions
String Functions
String Operators
Structure declaration
Test Control Structures & Functions
Trigonometric Functions
User-defined formats
Using reserved keywords as identifiers
Variable Declaration
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

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()

Since 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)

Since 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()

Since 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.