mirror of
https://github.com/fltk/fltk.git
synced 2026-05-30 21:25:30 +08:00
Minor improvement in Fl_Mac_App_Menu::custom_application_menu_items().
This commit is contained in:
@@ -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
|
if ([[menu itemAtIndex:2] action] != @selector(printPanel)) { // the 'Print' item was removed
|
||||||
[menu insertItem:[NSMenuItem separatorItem] atIndex:1];
|
[menu insertItem:[NSMenuItem separatorItem] atIndex:1];
|
||||||
to_index = 2;
|
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];
|
NSInteger count = [menu numberOfItems];
|
||||||
createSubMenu(menu, m, NULL, @selector(customCallback)); // add new items at end of application menu
|
createSubMenu(menu, m, NULL, @selector(customCallback)); // add new items at end of application menu
|
||||||
NSInteger count2 = [menu numberOfItems];
|
NSInteger count2 = [menu numberOfItems];
|
||||||
|
|||||||
+1
-1
@@ -281,7 +281,7 @@ int main(int argc, char **argv) {
|
|||||||
Fl_Menu_Item custom[] = {
|
Fl_Menu_Item custom[] = {
|
||||||
{"Preferences…", 0, test_cb, NULL, FL_MENU_DIVIDER},
|
{"Preferences…", 0, test_cb, NULL, FL_MENU_DIVIDER},
|
||||||
{"Radio1", 0, test_cb, NULL, FL_MENU_RADIO | FL_MENU_VALUE},
|
{"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}
|
{0}
|
||||||
};
|
};
|
||||||
Fl_Mac_App_Menu::custom_application_menu_items(custom);
|
Fl_Mac_App_Menu::custom_application_menu_items(custom);
|
||||||
|
|||||||
Reference in New Issue
Block a user