OpenGLEAN
OpenGLEAN User Support
Home page | Introduction | Documentation | Files | Examples | Proposals | Authors | Links


OpenGLEAN Development
Summary | CVS | (discussion via home page) | (contact via home page) | (suggestion box) | License | Todo | Bugs

Menu Management
[OpenGLEAN API Reference]

Collaboration diagram for Menu Management:

DEPRECATED

The entire GLUT like menu system is tentatively deprecated. A menu API may be exported to an external library, or you can create your own. In either case, the recommended structure to use is the more GLUT like menu-windows.

OpenGLEAN provides an implementation of GLUT like cascading text menus. The menus are basically association lists: A string of text is associated either with an integer or with a submenu. If with a submenu, then dragging the mouse over the submenu's name brings up the submenu. Submenu items can in turn have items with menus-or-integers. This allows you to nest menus to any desired depth.

Actual action generally occurs when an integer-bound item is selected. The integer can be any integer of the application's choosing, provided that it fits into a variable of type int. Enumerated values, array indices, and OpenGL and OpenGLEAN ids are common choices. The item selection is handed to a menu callback that you specify via glutCreateMenu(). (Each menu can have its own callback, or you can use one callback for all menus, or something inbetween, according to your application's needs snf your own preferences.)

The original GLUT documentation disclaimed GLUT menus as being an attempt at ``a full-featured user interface''. Certainly, the GLUT menus are limited, but they are functional. At present, they are the only officially supported mechanism for creating practical menus. (Using subwindows in your own application window is possible, but the possibility of having your menus occluded by other applications' windows is a bit irritating.)

The following comment appeared in at least three spots in the freeglut code. Here in OpenGLEAN we consolidate it into this overview, which seems more appropriate and useful. It appears to be an analysis of how old GLUT worked on WIN32 (it certainly is very different from old GLUT on X11). Some of the freeglut, hence OpenGLEAN, menu problems seem to arise from trying to emulate the WIN32 behavior.

Do not execute the application's mouse callback if a menu is hooked to this button. In that case an appropriate private call should be generated.

Near as I can tell, this is the menu behaviour:





SourceForge.net Logo Supported in part by SourceForge.net.

Generated on Fri Sep 16 20:15:36 2005 for OpenGLEAN by doxygen 1.4.3
The OpenGLEAN project is hosted by olib.org and SourceForge.