#if wxUSE_MENUS_NATIVE
-static void SetInvokingWindow( wxMenu *menu, wxWindow* win )
-{
- menu->SetInvokingWindow( win );
-
- wxMenuItemList::compatibility_iterator node = menu->GetMenuItems().GetFirst();
- while (node)
- {
- wxMenuItem *menuitem = node->GetData();
- if (menuitem->IsSubMenu())
- {
- SetInvokingWindow( menuitem->GetSubMenu(), win );
- }
-
- node = node->GetNext();
- }
-}
-
extern "C" {
static
void wxPopupMenuPositionCallback( GtkMenu *menu,
wxCHECK_MSG( menu != NULL, false, wxT("invalid popup-menu") );
- SetInvokingWindow( menu, this );
+ menu->SetInvokingWindow( this );
menu->UpdateUI();
gtk_main_iteration();
}
+ menu->SetInvokingWindow( NULL );
+
return true;
}