Do native macOS menus support custom components?

in the Juce documentation there is info for PopupMenu::addCustomItem():

Note that native macOS menus do support custom components.

I am sorry I am not sure if I understand it. I use PopupMenu::addCustomItem() in my audio plugin to show special functionalities. And it works on both Windows 10 and OSX (Big Sur with Apple M1).

So I want to assure it will work always for all my clients. So could anyone explain me what exactly mean that “native macOS menus do support custom components.”???

For any help great thanks in advance.

Best Regards

I think this is a typo, it should read “native macOS menus do not support custom components”. The comment is talking about using the PopupMenu to populate the main menu bar in a standalone application - in this situation, custom components are not supported. If you are displaying a non-native menu (e.g. calling PopupMenu::showMenuAsync) then custom components should work as expected on all platforms.

Hmm… Great thanks for your help.
Actually it’s shame to admit that I am not sure if I understand what does mean “native menu”.
So as I understand in your example PopupMenu::showMenuAsync the menu will not be native? But what about PopupMenu::showAt(). Will it show native menu or not? In other words should it be OK on OSX platform or not?

Maybe the term ‘native’ is a bit misleading. The important distinction is between menus created and drawn into a Component by JUCE itself, and other menus which are drawn/presented by the OS. As far as I’m aware, the mac main menu is the only “native” menu that might be created from a PopupMenu. If the menu is not being added to the mac main menu, it will be displayed as a non-native JUCE menu.

Put another way, if the menu is drawn with the same look and feel as the rest of your app, it’s a JUCE (non-native) menu. If the menu looks like a standard OS control (e.g. the main menu at the top of the screen on macOS), then it’s a native menu.

1 Like

Whilst we’re on the subject of macOS native menus it would be grand if they would respect the disabled flag :wink: