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.
This commit is contained in:
ManoloFLTK
2024-02-20 16:00:01 +01:00
parent 4649188cf6
commit ba5ed296e9
4 changed files with 63 additions and 25 deletions

View File

@@ -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();
}