---
name: "d_menu_proc"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/d_menu_proc"
---

# d\_menu\_proc(3alleg)

Dialog procedure implementing a menu bar object. Allegro game programming library.

## NAME

d\_menu\_proc - Dialog procedure implementing a menu bar object. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**int d\_menu\_proc(int msg, DIALOG \*d, int c);**

## DESCRIPTION

This object is a menu bar which will drop down child menus when it is  clicked or if an alt+key corresponding to one of the shortcuts in the  menu is pressed. It ignores a lot of the fields in the dialog structure,  in particular the color is taken from the gui\_\*\_color variables, and the  width and height are calculated automatically (the w and h fields from  the DIALOG are only used as a minimum size.) The dp field points to an  array of menu structures: see do\_menu() for more information. The top  level menu will be displayed as a horizontal bar, but when child menus  drop down from it they will be in the normal vertical format used by  do\_menu(). When a menu item is selected, the return value from the menu  callback function is passed back to the dialog manager, so your callbacks  should return D\_O\_K, D\_REDRAW, or D\_CLOSE.

## SEE ALSO

[**active\_menu**(3alleg)](/active_menu/3alleg.md), [**gui\_menu\_draw\_menu**(3alleg)](/gui_menu_draw_menu/3alleg.md), [**exgui**(3alleg)](/exgui/3alleg.md)
