---
name: "al_insert_menu_item"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_insert_menu_item"
---

# al\_insert\_menu\_item(3)

Allegro 5 API

## NAME

al\_insert\_menu\_item - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_native_dialog.h>
  int al_insert_menu_item(ALLEGRO_MENU *parent, int pos, char const *title,
     uint16_t id, int flags, ALLEGRO_BITMAP *icon, ALLEGRO_MENU *submenu)
  ```

## DESCRIPTION

Inserts a menu item at the spot specified. See the introductory text for a detailed explanation of how the `pos` parameter is interpreted.

The `parent` menu can be a popup menu or a regular menu. To underline one character in the `title`, prefix it with an ampersand.

The `flags` can be any combination of:

- ALLEGRO\_MENU\_ITEM\_DISABLED

  The item is “grayed out” and cannot be selected.

- ALLEGRO\_MENU\_ITEM\_CHECKBOX

  The item is a check box. This flag can only be set at the time the menu is created. If a check box is clicked, it will automatically be toggled.

- ALLEGRO\_MENU\_ITEM\_CHECKED

  The item is checked. If set, ALLEGRO\_MENU\_ITEM\_CHECKBOX will automatically be set as well.

The `icon` is not yet supported.

The `submenu` parameter indicates that this item contains a child menu. The child menu must have previously been created with `al_create_menu`, and not be associated with any other menu.

Returns the index at which the item was inserted (which can be different than what is implied by `pos`), or -1 if there was an error.

## SINCE

5\.1.0

## SEE ALSO

[al\_append\_menu\_item(3)](/al_append_menu_item/3.md), [al\_remove\_menu\_item(3)](/al_remove_menu_item/3.md)
