From 6edf1107031284fdcf5e6eabc6b87a7367e28185 Mon Sep 17 00:00:00 2001
From: David Elliott <dfe@tgwbd.org>
Date: Tue, 30 Mar 2004 00:56:09 +0000
Subject: [PATCH] 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
---
 src/gtk/menu.cpp  | 9 ++-------
 src/gtk1/menu.cpp | 9 ++-------
 2 files changed, 4 insertions(+), 14 deletions(-)

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
-- 
2.47.2