Dokumentaro de Gambaso
Compilation & Installation
Components
Documents
Indekso de Lingvo
Language Overviews
LeguMin
Lexicon
Component
Gambaso
Registro

event handler

An Event handler is a public Method of a Class that is called each time an Event is raised by an Object having an observer of the same Class.

The name of the event handler is the "event name" of the Object, followed by an underscore, and the name of the event.

The event name of an object is usually the name you define in the development environment, but can be anything you want. This name is attributed at object creation by the NEW instruction.

Sample

hButton = NEW Button(ME) AS "MyButton"
...
PUBLIC PROCEDURE MyButton_Click()

  PRINT "My button was clicked !"

END

In this case, the "event name" is "MyButton", which was defined for the Object hButton of the Class Button.

The name of the event handler MyButton_Click() is formed from the "event name" "MyButton", followed by an underscore and the name of the event Click.

See also