- menu->Window->State.MouseX =
- window->State.MouseX + glutGet( GLUT_WINDOW_X ) - menu->X;
- menu->Window->State.MouseY =
- window->State.MouseY + glutGet( GLUT_WINDOW_Y ) - menu->Y;
+ /* Set position of mouse relative to top-left menu in menu's window state (could as well set 0 at creation time...) */
+ menu->Window->State.MouseX = mouse_pos.X - menu->X;
+ menu->Window->State.MouseY = mouse_pos.Y - menu->Y;
+
+ /* Menu status callback */
+ if (fgState.MenuStateCallback || fgState.MenuStatusCallback)
+ {
+ fgStructure.CurrentMenu = menu;
+ fgStructure.CurrentWindow = window;
+ if (fgState.MenuStateCallback)
+ fgState.MenuStateCallback(GLUT_MENU_IN_USE);
+ if (fgState.MenuStatusCallback)
+ /* window->State.MouseX and window->State.MouseY are relative to client area origin, as needed */
+ fgState.MenuStatusCallback(GLUT_MENU_IN_USE, window->State.MouseX, window->State.MouseY, fgState.MenuStatusCallbackData);
+ }