-static void wxMenubarUnsetInvokingWindow( wxMenu *menu )
-{
- menu->SetInvokingWindow( NULL );
- wxMenuItemList::compatibility_iterator node = menu->GetMenuItems().GetFirst();
-
- while (node)
- {
- wxMenuItem *menuitem = node->GetData();
- if (menuitem->IsSubMenu())
- wxMenubarUnsetInvokingWindow( menuitem->GetSubMenu() );
-
- node = node->GetNext();
- }
-}
-
-static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win )
-{
- menu->SetInvokingWindow( win );
- wxMenuItem *menuitem;
- wxMenuItemList::compatibility_iterator node = menu->GetMenuItems().GetFirst();
-
- while (node)
- {
- menuitem = node->GetData();
- if (menuitem->IsSubMenu())
- wxMenubarSetInvokingWindow( menuitem->GetSubMenu() , win );
-
- node = node->GetNext();
- }
-}
-
-void wxMenuBar::UnsetInvokingWindow()
-{
- m_invokingWindow = NULL;
- wxMenubarUnsetInvokingWindow(m_appleMenu);
-
- wxMenu *menu;
- wxMenuList::compatibility_iterator node = m_menus.GetFirst();
-
- while (node)
- {
- menu = node->GetData();
- wxMenubarUnsetInvokingWindow( menu );
-
- node = node->GetNext();
- }
-}
-
-void wxMenuBar::SetInvokingWindow(wxFrame *frame)
-{
- m_invokingWindow = frame;
- wxMenubarSetInvokingWindow(m_appleMenu, frame);
-
- wxMenu *menu;
- wxMenuList::compatibility_iterator node = m_menus.GetFirst();
-
- while (node)
- {
- menu = node->GetData();
- wxMenubarSetInvokingWindow( menu, frame );
-
- node = node->GetNext();
- }
-}
-