Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rebuilding menus (menuNeedsUpdate:) and System Preferences keyboard shortcuts.



> At first I thought the solution was obvious: I was building these menus as needed, in the NSMenu delegate method, -menuNeedsUpdate: This method only gets called when the user goes to look at the menu. So, if these dynamic menus were only built in -menuNeedsUpdate:, then clearly the keyboard shortcuts defined in System Preferences for any items in such menus would note work until after the user had opened the menu at least once (thus populating it in -menuNeedsUpdate: and allowing the defined shortcut actually to apply to something, because before this the menu wouldn't have existed).

  I've noticed a bug where calling -[NSMenuItem setKeyEquivalent:]
does not update unless you first set it to @"" then to the target. I
don't believe I remembered to file this with Apple ...

--
I.S.
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Rebuilding menus (menuNeedsUpdate:) and System Preferences keyboard shortcuts. (From: Keith Blount <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.