| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (10 out of 12)

Dynamic Menus and Callback Procedures

From the viewpoint of a callback procedure, static and dynamic menus are identical. Every callback procedure technique works in the same way with either type of menu. This invariance exists because:

The GMS compiler generates new menu indexes each time it recompiles a dynamic menu, and may not use the same index values from one compilation to the next. Therefore a callback procedure that is invoked repeatedly from the same dynamic menu must not assume that the menu indexes in callback arguments are the same from call to call.

GMS deletes the menu translation for a dynamic menu as soon as the menu is undisplayed. Therefore a dynamic menu index value obtained from an activation path should never be used outside the context of the callback procedure invocation that obtained the value.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (10 out of 12)

Copyright © 1997 Gensym Corporation, Inc.