On 24 Nov 2019, at 22:28, Kurt Bigler via Cocoa-dev wrote:

[…] The idea for least inefficiency given the global updating pass is to defer (akin to lazy evaluation) the actual menu item updating until the last possible moment. The last possible moment for mouse access is when the user clicks in the menu bar.

Have a look at NSMenu’s delegate property which allows you to set a delegate implementing the NSMenuDelegate protocol: https://developer.apple.com/documentation/appkit/nsmenudelegate

With a menu delegate you can lazily update the menu (menuNeedsUpdate:) or you can even bypass updating the menu for key events by implementing menuHasKeyEquivalent:forEvent:target:action:.
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to