Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

glutattachmenu(3glut) [osx man page]

glutAttachMenu(3GLUT)						       GLUT						     glutAttachMenu(3GLUT)

NAME
glutAttachMenu - attaches a mouse button for the current window to the identifier of the current menu; glutDetachMenu - detaches an attached mouse button from the current window. SYNTAX
#include <GLUT/glut.h> void glutAttachMenu(int button); void glutDetachMenu(int button); ARGUMENTS
button The button to attach a menu or detach a menu. DESCRIPTION
glutAttachMenu attaches a mouse button for the current window to the identifier of the current menu; glutDetachMenu detaches an attached mouse button from the current window. By attaching a menu identifier to a button, the named menu will be popped up when the user presses the specified button. button should be one of GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, and GLUT_RIGHT_BUTTON. Note that the menu is attached to the button by identifier, not by reference. SEE ALSO
glutCreateMenu, glutMouseFunc, glutMenuStatusFunc AUTHOR
Mark J. Kilgard (mjk@nvidia.com) GLUT
3.7 glutAttachMenu(3GLUT)

Check Out this Related Man Page

glutCreateMenu(3GLUT)						       GLUT						     glutCreateMenu(3GLUT)

NAME
glutCreateMenu - creates a new pop-up menu. SYNTAX
#include <GLUT/glut.h> int glutCreateMenu(void (*func)(int value)); ARGUMENTS
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. EXAMPLE
Here is a quick example of how to create a GLUT popup menu with two submenus and attach it to the right button of the current window: int submenu1, submenu2; submenu1 = glutCreateMenu(selectMessage); glutAddMenuEntry("abc", 1); glutAddMenuEntry("ABC", 2); submenu2 = glutCreateMenu(selectColor); glutAddMenuEntry("Green", 1); glutAddMenuEntry("Red", 2); glutAddMenuEntry("White", 3); glutCreateMenu(selectFont); glutAddMenuEntry("9 by 15", 0); glutAddMenuEntry("Times Roman 10", 1); glutAddMenuEntry("Times Roman 24", 2); glutAddSubMenu("Messages", submenu1); glutAddSubMenu("Color", submenu2); glutAttachMenu(GLUT_RIGHT_BUTTON); 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 dis- play callbacks when pop-up menus are deactivated. The SERVER_OVERLAY_VISUALS convention is used to determine if overlay visuals are avail- able. SEE ALSO
glutCreateWindow, glutDestroyMenu, glutSetMenu, glutAttachMenu AUTHOR
Mark J. Kilgard (mjk@nvidia.com) GLUT
3.7 glutCreateMenu(3GLUT)
Man Page