EtsT_Tool_Popup_Menu_Callback
Note: Requires OPNET Development Kit
Abstract
Callback: Called when the user selects an item from a pop-up menu.
Syntax
<popup_menu_callback_name> (state_ptr, selected_item, selected_item_text)
| Argument | Type | Description |
|---|---|---|
state_ptr |
void * |
A pointer to arbitrary data specified when the pop-up menu callback was registered. |
selected_item |
int |
The index of the item selected by the user. |
selected_item_text |
const char * |
The text of the item selected by the user. |
Return Type
void
No return value.
Header
ets_api_tool.h
Details
When an Ets client opens a pop-up menu by calling Ets_Tool_Popup_Menu_Open(), it must specify a function to handle the user's selection. This callback function is passed a pointer to arbitrary data that was specified in the call to Ets_Tool_Popup_Menu_Open(), as well as the index and text of the menu item chosen by the user. The callback function can use either of these last two arguments as convenient to determine the action to be taken. (If the menu is generated dynamically, it might be more convenient to use the text of the item rather than its index.)
The data addressed by the state pointer can contain any data necessary to describe the context of the operation to the callback function; it is not otherwise used by the system and can be NULL if not used.