We made a design decision a long time ago to make the "freeglut" menus look the same between Windows and X; while I think it was a good decision, we have been living with the results ever since. I have been working on the menus under Windows using the GLUT "glutmech" demo--which has three or four levels of submenu--and they have been giving me horrors. I have not been able to track Windows messages and settings of the current window with the appearances and disappearances of the mouse manipulations and the various menu subwindows.
The phenomenon that I was trying to fix was that if you click and release the moust button to bring up the menu, drag the mouse so as to select three or four levels of submenu, then drag the mouse up out of the menu system entirely, and then drag the mouse around so that it enters a higher-level menu from the bottom, the whole menu system disappears. If the menu selection you have just moved the mouse onto has a submenu, the submenu appears by itself. The menus are still active, though, because they absorb the next mouse click.
It has been extremely frustrating.
John F. Fay
Technical Fellow, Jacobs/Sverdrup TEAS Group
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of Joe Krahn
Sent: Tuesday, October 03, 2006 12:27 PM
To: FreeGLUT developers list
Subject: [Freeglut-developer] Menus don't function right
Win32 menus are not getting cleared when the parent window loses focus.
I think that X11 menus may be the same. Also, the Win32 parent window can sometimes pop in front of the menu window. The demo 'one'
illustrates it. Activate the menu near the right of the parent window, then move to the 3rd-level menu, then go back to the parent menu without crossing over the 2nd-level menu. The main window gets a WM_ACTIVATE message, and comes to the front.
There are some other less critical issues as well. a sub-menu window should slightly overlap it's parent, unless it gets pushed to the left due to lack of space. There should also be a minimum width.
One issue is how people feel about replicating GLUT precisely versus just doing a good job. In Win32 GLUT, the menus are system drawn, and therefore work pretty well. X11 GLUT menus never did a good job of dealing with adjusting crowded menus without obscuring the parent, and some other deficiencies.
My preference is not to avoid replicating X11 GLUT. Win32 native menus, as used in Win32-GLUT, is a definitely a good design model for Win32 FreeGLUT, and a better match to modern X11 menus than old X11 GLUT. But, I would prefer to get the same appearance on all platforms.
It may also be worth having a FreeGLUT config setting for menu colors, fonts, and border appearance, which could give a close match to native menus across all platforms.
Lastly, I think it would be a small but very useful extension to support horizontal menus that can stay visible, so that a 'modern' menu is possible. Alternatively, a similar effect can be obtained if the main menu is user-drawn and a function is added to manually pop up a menu at a specific location.
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
Freeglut-developer mailing list