summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-02-20 16:00:01 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-02-20 16:00:01 +0100
commitba5ed296e9faf92a047f68e83e9348eb43a40eec (patch)
tree4edae89c3cf0ce5bf499ef1ceb8f86926d0ed40e /test
parent4649188cf67c1c19dac8262dce7789384ded2ded (diff)
Improve implementation of the macOS Window menu
The macOS Window menu is connected to the item array of the macOS menubar via FL_SUBMENU_POINTER. This facilitates memorization of pointers to items of the macOS menubar because the item array no longer changes each time a window opens of gets closed.
Diffstat (limited to 'test')
-rw-r--r--test/menubar.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/menubar.cxx b/test/menubar.cxx
index e46a60be0..a0424732d 100644
--- a/test/menubar.cxx
+++ b/test/menubar.cxx
@@ -202,8 +202,7 @@ void menu_location_cb(Fl_Widget* w, void* data)
smenubar->callback(test_cb);
}
else { // switch to window menu bar
- menubar->menu(smenubar->menu());
- smenubar->clear();
+ menubar->copy(smenubar->menu());
delete smenubar;
menubar->show();
}