summaryrefslogtreecommitdiff
path: root/beos/beos_scaffolding.cpp
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-02 17:26:06 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-02 17:26:06 +0000
commit2dd3c20aabb5e52432c281e331f98304aabe0777 (patch)
tree26dd9314f6e2800be3d9102e2b933f7a70443a86 /beos/beos_scaffolding.cpp
parent0f7122113436b2c019489957fc53cda05293a5d7 (diff)
downloadnetsurf-2dd3c20aabb5e52432c281e331f98304aabe0777.tar.gz
netsurf-2dd3c20aabb5e52432c281e331f98304aabe0777.tar.bz2
Make sure menu items all get the target set recursively.
svn path=/trunk/netsurf/; revision=5474
Diffstat (limited to 'beos/beos_scaffolding.cpp')
-rw-r--r--beos/beos_scaffolding.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/beos/beos_scaffolding.cpp b/beos/beos_scaffolding.cpp
index 859e416ae..dadab0c33 100644
--- a/beos/beos_scaffolding.cpp
+++ b/beos/beos_scaffolding.cpp
@@ -1081,6 +1081,16 @@ NSBrowserWindow *nsbeos_get_bwindow_for_scaffolding(nsbeos_scaffolding *scaffold
return scaffold->window;
}
+static void recursively_set_menu_items_target(BMenu *menu, BHandler *handler)
+{
+ menu->SetTargetForItems(handler);
+ for (int i = 0; menu->ItemAt(i); i++) {
+ if (!menu->SubmenuAt(i))
+ continue;
+ recursively_set_menu_items_target(menu->SubmenuAt(i), handler);
+ }
+}
+
void nsbeos_attach_toplevel_view(nsbeos_scaffolding *g, BView *view)
{
LOG(("Attaching view to scaffolding %p", g));
@@ -1144,16 +1154,7 @@ void nsbeos_attach_toplevel_view(nsbeos_scaffolding *g, BView *view)
g->url_bar->SetTarget(view);
- for (int i = 0; g->menu_bar->ItemAt(i); i++) {
- if (!g->menu_bar->SubmenuAt(i))
- continue;
- g->menu_bar->SubmenuAt(i)->SetTargetForItems(view);
- for (int j = 0; g->menu_bar->SubmenuAt(i)->ItemAt(j); j++) {
- if (!g->menu_bar->SubmenuAt(i)->SubmenuAt(j))
- continue;
- g->menu_bar->SubmenuAt(i)->SubmenuAt(j)->SetTargetForItems(view);
- }
- }
+ recursively_set_menu_items_target(g->menu_bar, view);
// add toolbar shortcuts
BMessage *msg;