Syntax:
on close {window} {block} on {button} {block} on {menuitem} {block} on {style} {block} on change in {textarea}/{textfield} {block} on mouse down/up/move/drag in {component} {block} on mouse enter/exit {component} {block} on key pressed/released/typed in {component} {block}
Keyword handler:
net.eclecity.linguist.graphics.keyword.GraphicsKOn.class
Runtime handler(s):
net.eclecity.linguist.graphics.handler.GraphicsHOn.class
Function:
Define the action to take when a particular event occurs, as follows:
on close {window} defines what to do when the user clicks in a window's close box.
on {button} defines what to do when the user clicks in a button.
on {menuitem} defines what to do when the user clicks in a menuitem.
on {style} defines what to do when the user clicks on any text having the named style (in a textpanel). This is the way to implement hot-linked text.
on change in {textarea}/{textfield} defines what to do when the content of a textarea or textfield changes.
on mouse defines what to do when a mouse event occurs in the named component.
on key defines what to do when a key is pressed in the named component (i.e. while the component has the focus).
Every event causes a packet of information to be stored in a temporary location that is private to the thread that handles the callback. This enables a number of useful values to be available for the duration of that callback only. For example, the location of the mouse is available only after an on mouse statement. These values can all be found in Numeric Values.
Example(s):
on close MainWindow exit on OKButton go to OKButtonCB on ExitLinkStyle send "exit" to parent on mouse down in MainWindow go to PlayErrorBeep on key pressed in ControlWindow go to ShowKeyCode