FLTK logo

[master] 2ef4a81 - Minor improvement in Fl_Mac_App_Menu::custom_application_menu_items().

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 2ef4a81 - Minor improvement in Fl_Mac_App_Menu::custom_application_menu_items(). "ManoloFLTK" Feb 05, 2022  
 
commit 2ef4a81d183ccc43fb4183c39470a97bda4c75f8
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Sat Feb 5 09:01:51 2022 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Sat Feb 5 09:01:51 2022 +0100

    Minor improvement in Fl_Mac_App_Menu::custom_application_menu_items().

 src/Fl_MacOS_Sys_Menu_Bar.mm | 2 +-
 test/menubar.cxx             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git src/Fl_MacOS_Sys_Menu_Bar.mm src/Fl_MacOS_Sys_Menu_Bar.mm
index 88200ea..5783351 100644
--- src/Fl_MacOS_Sys_Menu_Bar.mm
+++ src/Fl_MacOS_Sys_Menu_Bar.mm
@@ -507,7 +507,7 @@ void Fl_Mac_App_Menu::custom_application_menu_items(const Fl_Menu_Item *m)
   if ([[menu itemAtIndex:2] action] != @selector(printPanel)) { // the 'Print' item was removed
     [menu insertItem:[NSMenuItem separatorItem] atIndex:1];
     to_index = 2;
-  } else to_index = 4; // after the "Print Front Window/Toggle" items
+  } else to_index = 5; // after the "Print Front Window/Toggle" items and the separator
   NSInteger count = [menu numberOfItems];
   createSubMenu(menu, m, NULL, @selector(customCallback)); // add new items at end of application menu
   NSInteger count2 = [menu numberOfItems];
diff --git test/menubar.cxx test/menubar.cxx
index 1bb28ba..7a4f4d8 100644
--- test/menubar.cxx
+++ test/menubar.cxx
@@ -281,7 +281,7 @@ int main(int argc, char **argv) {
   Fl_Menu_Item custom[] = {
     {"Preferencesâ?¦",  0, test_cb, NULL, FL_MENU_DIVIDER},
     {"Radio1",        0, test_cb, NULL, FL_MENU_RADIO | FL_MENU_VALUE},
-    {"Radio2",        0, test_cb, NULL, FL_MENU_RADIO},
+    {"Radio2",        0, test_cb, NULL, FL_MENU_RADIO | FL_MENU_DIVIDER},
     {0}
   };
   Fl_Mac_App_Menu::custom_application_menu_items(custom);
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.