XPLMAppendMenuItemWithCommand

Function XPLMAppendMenuItemWithCommand 

Source
pub unsafe extern "C" fn XPLMAppendMenuItemWithCommand(
    inMenu: XPLMMenuID,
    inItemName: *const c_char,
    inCommandToExecute: XPLMCommandRef,
) -> c_int
Expand description

XPLMAppendMenuItemWithCommand

Like XPLMAppendMenuItem(), but instead of the new menu item triggering the XPLMMenuHandler_f of the containiner menu, it will simply execute the command you pass in. Using a command for your menu item allows the user to bind a keyboard shortcut to the command and see that shortcut represented in the menu.

Returns a negative index if the append failed (due to an invalid parent menu argument).

Like XPLMAppendMenuItem(), all menu indices are relative to your plugin’s menus only.