---
name: "init_menu"
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/init_menu"
---

# init\_menu(3alleg)

Low level initialisation of a menu. Allegro game programming library.

## NAME

init\_menu - Low level initialisation of a menu. Allegro game programming library.

## SYNOPSIS

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

**MENU\_PLAYER \*init\_menu(MENU \*menu, int x, int y);**

## DESCRIPTION

This function provides lower level access to the same functionality as  do\_menu(), but allows you to combine a popup menu with your own program  control structures. It initialises a menu, returning a pointer to a menu player object that can be used with update\_menu() and shutdown\_menu(). With these functions, you could implement your own version of do\_menu() with the lines:

```
   MENU_PLAYER *player = init_menu(menu, x, y);
   while (update_menu(player))
      ;
   return shutdown_menu(player);
```

## SEE ALSO

[**update\_menu**(3alleg)](/update_menu/3alleg.md), [**shutdown\_menu**(3alleg)](/shutdown_menu/3alleg.md), [**do\_menu**(3alleg)](/do_menu/3alleg.md)
