Re: manual item enabling
Re: manual item enabling
- Subject: Re: manual item enabling
- From: Allan Odgaard via Cocoa-dev <email@hidden>
- Date: Sun, 24 Nov 2019 22:37:17 +0100
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@hidden)
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:
This email sent to email@hidden