| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 9)

Callback Procedure Syntax

Syntactically, a callback procedure is an ordinary G2 procedure. Its only special property is that it accepts three arguments supplied by GMS. The signature for a GMS callback procedure is:

The procedure-name can be any unique name. The arguments are:

Argument Description
handle
The handle of the window that contains the menu from which the call originates
activation-info
An object containing detailed information about the context of the call
menu-index
The menu index of the leaf entry from which the call originates

Every callback procedure must take exactly these three arguments: you cannot omit any of them or define any in addition to them. This chapter refers to the three arguments that GMS passes to a callback procedure as callback arguments.

A callback procedure is free to ignore any or all callback arguments, and to make any desired use of them. Typically a callback procedure uses its arguments to determine what action to take.


Caution: When a callback procedure returns, GMS automatically deletes the activation-info. Do not try to use the activation-info outside the context of the callback procedure invocation that received it.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 9)

Copyright © 1997 Gensym Corporation, Inc.