OpenGLUT Documentation
Introduction | Documentation | Examples | Proposals | Authors | Copying | Todo | Bugs | Links

Menu Callbacks
[OpenGLUT API Reference]


void glutMenuDestroyFunc (void(*callback)(void))
void glutMenuStatusFunc (void(*callback)(int status, int x, int y))

Function Documentation

void glutMenuDestroyFunc void(*)(void)  callback  ) 

Destruction callback for menus.

callback Client menu destruction hook.
When a menu is destroyed, OpenGLUT will call this hook, if defined on that menu.

This callback is not bound to any window.

This callback is bound to a specific menu.

For emphasis, we repeat: This callback does not bind to any window.

What on Earth is rationale for this feature? Menus should only be destroyed when we ask them to be destroyed, or when their window is destroyed. In the former case, we already know that the menu is being destroyed because we requested it. In the latter case, it is easy for the client to track that if they care, via window-destruction callbacks.
See also:
glutCloseFunc(), glutCreateMenu(), glutDestroyMenu()

void glutMenuStatusFunc void(*)(int status, int x, int y)  callback  ) 

Modern variant of glutMenuStateFunc().

callback Client menu status hook.
Broadly, OpenGLUT operates in two modes. At any given time, it is either in menu mode (with a popup menu display, possibly with subitems) or it is not.

When moving from non-menu to menu status, callback (if defined) will be called with GLUT_MENU_IN_USE . Conversely, when moving from menu to non-menu status, callback (if defined) will be called with GLUT_MENU_NOT_IN_USE .

This differs from glutMenuStateFunc() in that callback is also given the x and y coordinates of the mouse when the menu state transition took place.

This callback is bound to both the current window and the current menu.

Your callback is not actually called presently.
See also:

OpenGLUT Development @ Sourceforge
Homepage | Summary | Files | CVS | Forums | Lists | Bugs | RFE

Generated on Sat Feb 5 01:47:29 2005 for OpenGLUT by doxygen
The OpenGLUT project is hosted by