From: David Elliott Date: Tue, 30 Mar 2004 00:56:09 +0000 (+0000) Subject: GetMenuBar() now traverses up the hierarchy so it no longer has to be done here. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6edf1107031284fdcf5e6eabc6b87a7367e28185 GetMenuBar() now traverses up the hierarchy so it no longer has to be done here. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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 diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 1d53ddd74f..3d7ac67525 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/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