Next: 6.2 glutSetMenuglutGetMenu Up: 6 Menu Management Previous: 6 Menu Management

## 6.1 glutCreateMenu

`glutCreateMenu` creates a new pop-up menu.

Usage

    int glutCreateMenu(void (*func)(int value));

`func`
  The callback function for the menu that is called when a menu entry from the menu is selected. The value passed to the callback is determined by the value for the selected menu entry.

Description

`glutCreateMenu` creates a new pop-up menu and returns a unique small integer identifier. The range of allocated identifiers starts at one. The menu identifier range is separate from the window identifier range. Implicitly, the current menu is set to the newly created menu. This menu identifier can be used when calling `glutSetMenu`.

When the menu callback is called because a menu entry is selected for the menu, the current menu will be implicitly set to the menu with the selected entry before the callback is made.

X Implementation Notes

If available, GLUT for X will take advantage of overlay planes for implementing pop-up menus. The use of overlay planes can eliminate display callbacks when pop-up menus are deactivated. The `SERVER_OVERLAY_VISUALS` convention [5] is used to determine if overlay visuals are available.

Next: 6.2 glutSetMenuglutGetMenu Up: 6 Menu Management Previous: 6 Menu Management