1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
.TH "ALLEGRO_MENU_INFO" "3" "" "Allegro reference manual" ""
.SH NAME
.PP
ALLEGRO_MENU_INFO \- Allegro 5 API
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <allegro5/allegro_native_dialog.h>
typedef\ struct\ ALLEGRO_MENU_INFO\ {
\f[]
.fi
.SH DESCRIPTION
.PP
A structure that defines how to create a complete menu system.
For standard menu items, the following format is used:
.IP
.nf
\f[C]
\ \ \ {\ caption,\ id,\ flags,\ icon\ }
\f[]
.fi
.PP
For special items, these macros are helpful:
.IP
.nf
\f[C]
ALLEGRO_START_OF_MENU(caption,\ id)
ALLEGRO_MENU_SEPARATOR
ALLEGRO_END_OF_MENU
\f[]
.fi
.PP
A well\-defined menu will begin with \f[C]ALLEGRO_START_OF_MENU\f[],
contain one or more menu items, and end with
\f[C]ALLEGRO_END_OF_MENU\f[].
A menu may contain sub\-menus.
An example:
.IP
.nf
\f[C]
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);
\f[]
.fi
.PP
If you prefer, you can build the menu without the structure by using
al_create_menu(3) and al_insert_menu_item(3).
.SH SEE ALSO
.PP
al_build_menu(3)
|