X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0d0a5520e2a944a21805302e01d17c122e41599..bcbd69875f4e9149eb22d922f94d99e307fdd280:/src/gtk/menu.cpp diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 1d53ddd74f..3d7ac67525 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -657,13 +657,8 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) // Is this menu on a menubar? (possibly nested) wxFrame* frame = NULL; - wxMenu* pm = menu; - while ( pm && !frame ) - { - if ( pm->IsAttached() ) - frame = pm->GetMenuBar()->GetFrame(); - pm = pm->GetParent(); - } + if(menu->IsAttached()) + frame = menu->GetMenuBar()->GetFrame(); // FIXME: why do we have to call wxFrame::GetEventHandler() directly here? // normally wxMenu::SendEvent() should be enough, if it doesn't work