I created a menu bar that I'm using in several Panels. To create the menu bar handle I use the main panel of my application:
if ((OdinMenuHandle = LoadMenuBar (MainPanelHandle, "WXGA120.uir", ODINMENU)) < 0)
return -1;
Now I want to use the ATTR_CHECKED attribute for a menu item. See the code below:
void CVICALLBACK DisableStoringCallback (int menuBar, int menuItem, void *callbackData, int panel){
// Disable (or enable) storing data in the flash memory.
if (disable_storing == FALSE){
SetMenuBarAttribute (OdinMenuHandle, ODINMENU_OPTIONS_DISABLE_STORING, ATTR_CHECKED, TRUE);
disable_storing = TRUE;
}
else{
SetMenuBarAttribute (OdinMenuHandle, ODINMENU_OPTIONS_DISABLE_STORING, ATTR_CHECKED, FALSE);
disable_storing = FALSE;
}
}
This works fine when the main panel of my application is the active panel. But if another panel (also using this menu) is active, the disable_storing variable is changed, but the menu item is not checked. You can only see that it is checked if the main panel is active.
How can I let the user see that the item is checked if another panel than the main panel is active?