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

Dynamic Menu Compilation and Display

By default, GMS completely constructs a dynamic menu from scratch every time the menu is to be displayed. The steps for constructing and displaying a dynamic menu are:

  1. Call the panel constructor to obtain a template list that defines the menu.

  2. Compile the template list into a menu translation.

  3. Store the menu translation in the compiled resource.

  4. Use the information in the compiled resource to build a menu instance.

  5. Display the menu in a G2 window.

By default, GMS completely deletes a dynamic menu after any callback procedure invoked through the menu has returned. The steps for deleting a dynamic menu are:

  1. Delete the menu instance.

  2. Delete the menu translation from the compiled resource.

  3. Delete all templates in the template list.

  4. Delete the template list itself.

By default, GMS repeats this sequence in its entirety every time it displays and undisplays a dynamic menu. Such repetition can be time-consuming, particularly if you repeatedly select and unselect the same dynamic cascading menu entry.

GMS provides techniques for reducing the overhead of repeatedly reconstructing dynamic menus, as described under Reducing Dynamic Menu Overhead.

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

Copyright © 1997 Gensym Corporation, Inc.