al_insert_menu_item(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

okay bestie, welcome to al_insert_menu_item(3) β€” that’s the title, and it lives in the Library Functions Manual as part of the Allegro 5 API. Buckle up, we’re inserting menu items with main character energy. πŸ’…

🌸 NAME 🌸

al_insert_menu_item β€” Allegro 5 API. The whole vibe is β€œinsert a menu item,” no cap. πŸ’–

✨ 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 β€” vintage but still iconic. πŸ‘‘

πŸ¦‹ SEE ALSO πŸ¦‹


Cute sign-off time: source/version line is the Allegro reference manual, and the original footer didn’t list a separate date, so there’s no date to report β€” no cap. That’s the page, bestie! πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms