ALLEGRO_MENU_INFO(3alleg5)

ALLEGRO_MENU_INFO3alleg5

Allegro 5 api

Usage

#include <allegro5/allegro_native_dialog.h>
typedef struct ALLEGRO_MENU_INFO {

Overview

A structure that defines how to create a complete menu system. For standard menu items, the following format is used:

   { caption, id, flags, icon }

For special items, these macros are helpful:

ALLEGRO_START_OF_MENU(caption, id)
ALLEGRO_MENU_SEPARATOR
ALLEGRO_END_OF_MENU

A well-defined menu will begin with ALLEGRO_START_OF_MENU, contain one or more menu items, and end with ALLEGRO_END_OF_MENU. A menu may contain sub-menus. An example:

ALLEGRO_MENU_INFO menu_info[] = {
   ALLEGRO_START_OF_MENU("&File", 1),
      { "&Open", 2, 0, NULL },
      ALLEGRO_START_OF_MENU("Open &Recent...", 3),
         { "Recent 1", 4, 0, NULL },
         { "Recent 2", 5, 0, NULL },
         ALLEGRO_END_OF_MENU,
      ALLEGRO_MENU_SEPARATOR,
      { "E&xit", 6, 0, NULL },
      ALLEGRO_END_OF_MENU,
   ALLEGRO_START_OF_MENU("&Help", 7),
      {"&About", 8, 0, NULL },
      ALLEGRO_END_OF_MENU,
   ALLEGRO_END_OF_MENU
};
ALLEGRO_MENU *menu = al_build_menu(menu_info);

If you prefer, you can build the menu without the structure by using al_create_menu(3alleg5) and al_insert_menu_item(3alleg5).

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

From allegro5-doc 2:5.2.10.1+dfsg-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.