Syntax
MenuItem *MenuItemNewO( const char *caption, PopUpMenu *popUp, int shortcut, const char *message, int id );
Arguments
caption the menu text. & marks the following character as the accelerator. MENU_SEPARATOR creates a separator. NULL is invalid.
popUp the submenu to open when the item is selected. A separator ignores this argument and accepts NULL.
shortcut the key code stored on the item, or NIL or 0 for no shortcut.
message the text shown when the item is current, or NULL for an empty string.
id the number stored on the item, or NIL for 0.
Return value
The new MenuItem object, or NULL when caption is NULL or a regular item has a NULL submenu. Release it with MenuItemFree().
Description
Include xdev-wtui-classes.h. Use `MenuItemNewO()` for a submenu and `MenuItemNewB()` for a callback. The C constructors take separate types for the two values accepted by the xBase constructor.
The constructor copies the caption and message. A regular item starts enabled and unchecked and takes ownership of `popUp`. `MenuItemFree()` releases that submenu. The caller retains ownership of `popUp` if construction fails or creates a disabled separator.