+
+ /*
+ * Hide all submenu windows, and the root menu's window.
+ */
+ for ( menuEntry = menu->Entries.First; menuEntry;
+ menuEntry = menuEntry->Node.Next )
+ {
+ /*
+ * Is that an active submenu by any case?
+ */
+ if ( ( menuEntry->SubMenu != NULL ) && menuEntry->SubMenu->IsActive )
+ fgDeactivateSubMenu ( menuEntry ) ;
+ }
+
+ fgStructure.Window = current_window ;
+}
+
+/*
+ * Deactivates a menu pointed by the function argument.
+ */
+void fgDeactivateSubMenu( SFG_MenuEntry *menuEntry )
+{
+ SFG_Window *current_window = fgStructure.Window ;
+ SFG_MenuEntry *subMenuIter ;
+ /*
+ * Hide the present menu's window
+ */
+ fgSetWindow ( menuEntry->SubMenu->Window ) ;
+ glutHideWindow () ;
+
+ /*
+ * Forget about having that menu active anymore, now:
+ */
+ menuEntry->SubMenu->Window->ActiveMenu = NULL ;
+ menuEntry->SubMenu->IsActive = FALSE ;
+
+ /*
+ * Hide all submenu windows, and the root menu's window.
+ */
+ for ( subMenuIter = menuEntry->SubMenu->Entries.First; subMenuIter;
+ subMenuIter = subMenuIter->Node.Next )
+ {
+ /*
+ * Is that an active submenu by any case?
+ */
+ if ( ( subMenuIter->SubMenu != NULL ) && subMenuIter->SubMenu->IsActive )
+ fgDeactivateSubMenu ( subMenuIter ) ;
+ }
+
+ fgStructure.Window = current_window ;