At the top level, defining a dynamic popup menu is the same as defining a static popup menu, except that you use a different root template: a Dynamic Popup template. This template has the same attributes as an ordinary Popup Menu template, plus attributes that specify the panel constructor function and control the deletion of dynamically constructed templates. These attributes are shown in the following table.
To define a dynamic popup menu:
Gms-subpanel-constructor of the template to specify the appropriate panel constructor.
To display a dynamic popup menu:
Use gms-display-popup-menu, as described under Using G2 Configurations to Display a Popup Menu.
Use the gms-popup-subscriber mixin, as described under Using gms-popup-subscriber to Display a Popup Menu.
Use the techniques described under Configuring GMS to Handle Mouse Events.
gms-change-mode-template. In a dynamic menu, the checking and unchecking of gms-change-mode-template menu entries does not happen automatically. It is done using the API procedures gms-check-menu-entry, gms-uncheck-menu-entry, and gms-menu-entry-is-checked. For more information on these procedures see Checking and Unchecking Menu Entries.