API 설명서 > Menu manager menus > Object ProMenubutton > Function ProMenubuttonActionSet
Function ProMenubuttonActionSet
Description
Specifies the action to perform when the user selects a particular menu button added by the Creo Parametric TOOLKIT application.
This function affects Menu-Manager (mode-specific) menus only.
The action is defined by passing a pointer to a C function (the callback function) in the Creo Parametric TOOLKIT application that is to be called when the user selects that button.
If the button name supplied is the name of the menu, instead of one of the buttons on it, the function defines the exit action for the menu (the function to be called when the user selects a command from a different menu).
The arguments app_data and app_int are passed as input arguments to the command function whenever it is called. Use the function ProMenubuttonGenactionSet() when you need to pass more than two arguments.
NOTES:
The arguments app_data and app_int must be one of the following types:
Statically allocated variables.
Constants.
Dynamically allocated local variables, but only if a local command loop is activated in the routine that contains the declarations. The location of the variable is unknown if the routine making the declaration is not on the stack.
The menu must be loaded (via ProMenuFileRegister()) before the actions are specified.
Synopsis
#include <ProMenu.h>
ProMenubuttonActionSet
(
ProMenuName menuname
/* (In)
The name of the menu
*/
/* (In)
The name of the menu button
*/
/* (In)
The callback function
*/
ProAppData app_data
/* (In)
The general application data passed to the callback function when it is called
*/
int app_int
/* (In)
The integer application data passed to the callback function when it is called
*/
)
Returns
The function successfully defined the button action.
Either the menu or the button does not exist.
Sample Code References
User Guide References
도움이 되셨나요?