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.

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.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com