Using a New Menu
After you have defined your new menu, you need to know how to use it. This is normally done inside the command function of another menu button.
To Use a New Menu
Calling ProMenuCreate()
The first argument to
ProMenuCreate() is either
PROMENUTYPE_MAIN or
PROMENUTYPE_SUB. The usual choice is
PROMENUTYPE_MAIN (see the section
Submenus for detailed information about submenus). The second argument is the title of the menu. The last argument is the identifier of the displayed menu.
Calling ProMenuProcess()
The function
ProMenuProcess() takes a single input argument—the title of the menu. If the menu is the last one displayed, you can pass an empty string. The return value is meaningful only if you use the function
ProMenuDeleteWithStatus() as the exit action for the menu.
The function
ProMenuProcess() returns only when the menu is closed, as the result of a call to either
ProMenuDelete() or
ProMenuDeleteWithStatus(). The following is true for any code following the call to
ProMenuProcess():
1. The code does not get executed until the menu is closed.
2. The code gets executed before any command that causes an exit from the menu. When the user closes a menu by selecting another command, that command is put into the input buffer and is not executed until control passes from your application back to Creo Parametric.