/* Save the current window and menu and set the current window to the window whose menu this is */
SFG_Window *save_window = fgStructure.Window ;
SFG_Menu *save_menu = fgStructure.Menu ;
+ SFG_Window *parent_window = window->ActiveMenu->ParentWindow ;
fgSetWindow ( window ) ;
fgStructure.Menu = window->ActiveMenu ;
/* Execute the menu callback */
fgExecuteMenuCallback ( window->ActiveMenu ) ;
- fgDeactivateMenu ( window->ActiveMenu->ParentWindow ) ;
+ fgDeactivateMenu ( parent_window ) ;
/* Restore the current window and menu */
fgSetWindow ( save_window ) ;
* have everything inside it freed and we do not have to care...
*/
free( window );
+ if ( fgStructure.Window == window ) fgStructure.Window = NULL ;
}
/*
/*
* Destroy the window associated with the menu
*/
+ if ( fgStructure.Window == menu->Window )
+ fgSetWindow ( menu->ParentWindow ) ;
+
fgDestroyWindow ( menu->Window, TRUE ) ;
/*