Modify the text for a menu item
#include <Ap.h> int ApModifyItemText( ApMenuLink_t *menu, int item_num, char const *new_text );
ApModifyItemText() modifies the text for a menu item in a PhAB menu module. The arguments are:
ApModifyItemText() stores the address given by new_text; it doesn't make a copy of the string pointed to by new_text. Don't modify the string after calling this function |
You can call ApModifyItemText() at any time to set the menu item text and the effect will be seen when the menu is displayed. This allows to you set menu item text as soon as conditions within your application change.
In this example, mymenu is a pointer to the address of the menu name, which is equivalent to the instance name for the menu module.
/* Change ABN_opt1 to say "New Option 1 Text" */ ApModifyItemText( &mymenu, ABN_opt1, "New Option 1 Text" );
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
ApGetItemText(), ApModifyItemState()
"Changing menu-item text" in the Working with Code chapter of the Photon Programmer's Guide