Question

I have filled my NSPopUpButton with menu and submenus.

When I select a menuItem on the root menu (so, not a sub-menuItem), it propery displays the menuItem selected. And when I re-click on the popUp button, I get the selected menuItem under the mouse.

But if I select a sub-menuItem, it doesn't display it. And if I re-click on the popUp button, I don't get it under the mouse. Any time I click on the button, I have to look for the selected item diving in the menu hierarchy.

Any solution?

Was it helpful?

Solution

The Human Interface Guidelines state:

Avoid adding a submenu to an item in a pop-up menu. A submenu tends to hide choices too deeply and can be physically difficult for users to use.

I assume that since the practice is discouraged (albeit not that strongly) that it is not supported either. I can see how submenus would break some of NSPopUpButton's functionality, all of the item index related methods would not make sense. Those methods would have to use NSIndexPaths instead of simple indexes.

A potential substitute would be to use different indention levels in the menu to indicate hierarchy. I am about to try that myself.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top