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

Menu Callbacks
[OpenGLUT API Reference]


Functions

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.

Parameters:
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.

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

Todo:
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().

Parameters:
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.

Bug:
Your callback is not actually called presently.
See also:
glutMenuStateFunc()




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

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