Invoked when a menu is about to be displayed at the start of a tracking session so the delegate can specify the number of items in the menu.
- macOS 10.3+
The menu object about to be displayed.
The number of menu items in the menu.
If you return a positive value, the menu is resized by either removing or adding items. Newly created items are blank. After the menu is resized, your
menu: method is called for each item. If you return a negative value, the number of items is left unchanged and
menu: is not called. If you can populate the menu quickly, you can implement
menu instead of