1ALLEGRO_MENU_INFO(3)                                      ALLEGRO_MENU_INFO(3)
2
3
4

NAME

6       ALLEGRO_MENU_INFO - Allegro 5 API
7

SYNOPSIS

9              #include <allegro5/allegro_native_dialog.h>
10
11              typedef struct ALLEGRO_MENU_INFO {
12

DESCRIPTION

14       A  structure  that  defines  how to create a complete menu system.  For
15       standard menu items, the following format is used:
16
17                 { caption, id, flags, icon }
18
19       For special items, these macros are helpful:
20
21              ALLEGRO_START_OF_MENU(caption, id)
22              ALLEGRO_MENU_SEPARATOR
23              ALLEGRO_END_OF_MENU
24
25       A well-defined menu will begin with ALLEGRO_START_OF_MENU, contain  one
26       or  more menu items, and end with ALLEGRO_END_OF_MENU.  A menu may con‐
27       tain sub-menus.  An example:
28
29              ALLEGRO_MENU_INFO menu_info[] = {
30                 ALLEGRO_START_OF_MENU("&File", 1),
31                    { "&Open", 2, 0, NULL },
32                    ALLEGRO_START_OF_MENU("Open &Recent...", 3),
33                       { "Recent 1", 4, 0, NULL },
34                       { "Recent 2", 5, 0, NULL },
35                       ALLEGRO_END_OF_MENU,
36                    ALLEGRO_MENU_SEPARATOR,
37                    { "E&xit", 6, 0, NULL },
38                    ALLEGRO_END_OF_MENU,
39                 ALLEGRO_START_OF_MENU("&Help", 7),
40                    {"&About", 8, 0, NULL },
41                    ALLEGRO_END_OF_MENU,
42                 ALLEGRO_END_OF_MENU
43              };
44
45              ALLEGRO_MENU *menu = al_build_menu(menu_info);
46
47       If you prefer, you can build the menu without the  structure  by  using
48       al_create_menu(3) and al_insert_menu_item(3).
49

SEE ALSO

51       al_build_menu(3)
52
53
54
55Allegro reference manual                                  ALLEGRO_MENU_INFO(3)
Impressum