More menu fun - I’ve narrowed my cross platform menus down to a single menu using dynamic constants and the “QuitMenuItem”, “ApplicationMenuItem”, and “PrefsMenuItem” Super assignments. However, I can’t determine how to force the order of the items that get moved to the ApplicationsMenu on macOS. The issue is that my “Enter License” and “Preferences” entries are appearing above the “About …” menuitem.
The About… menuitem is in the Help menu as the first item while the Preferences and License menuitems are in the File menu along with the Quit menuitem.
Is there some mechanism to force the order in the Applications menu in this situation?
I guess Xojo (or the OS) iterates through all menus, from left to right, and just moves what it finds as ApplicationMenuItem to the Application menu, in the order it finds them.
I think Xojo lacks functions for that. A ugly solution would be, in the app’s Open event (or where appropriate) to remove the items you know are already in the Application menu and add them back in the order you want them (I don’t remember if you can access the Application menu directly, but I’d guess you can add them to their original menu and they’d get relocated in the Application menu in the order you re-add them).
Just a guess.
A feature request to be able to handle menu items in the Application menu better would be great.
@Paul_Lefebvre - any input on this?
Bump - @Paul_Lefebvre, any thoughts on this? Any workarounds?
I’m not really familiar with how this part of the Mac framework builds out those menus. I recommend you create a Feedback case with a sample project so that we can look into seeing how the order is determined.
Thanks, will do. I was hoping that there was some magic that could be applied
Did you try to put them in the same Menu, in your prefered order ?
I tried that, but that changes the order for Windows and Linux …
I’m happy with my configuration for ARGen and Lifeboat. From left to right in the menus in order:
Edit > Preferences / Options : PrefsMenuItem
Help > About : ApplicationMenuItem
Help > PrefsSeparator (-) : ApplicationMenuItem
Help > Check For Updates : ApplicationMenuItem
Help > License : MenuItem
It ends up leaving License in the Help menu on Mac, but everything else seems to fit well. Honestly it was just a lot of experimentation. I can’t really suggest anything better than play with it until you like it, sorry
Thanks, Tim. I’ll give that a shot.
Alphabetized ? (except License)
I add two MenuItems in the Preferences (Super set to PrefsMenuItem) and only one appears with a coma as the keyboard shortcut (the second).
So, I trashed the cache contents, etc.
Same, unwanted result.
So I set the Super to AppleMenuItems for both MenuItems, and I get my two entries where I want!
This has to be expected, as Mac OS X takes care of not setting command-, twice (and the latter overrides the former).
Only one MenuItem appears in the Application Menu (and that was the problem).
Also, it is either Xojo or macOS that added the coma, not me. And I do not care about that (I think).