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

2008-12-02 Thread Keith Blount
Many thanks again for your reply, much appreciated, and for your suggestions. Actually, I think I might be able to improve things with a better use of -menuHasKeyEquivalent..., if I understand correctly. It's not quite as bad as all the menus are populated for every key combo. What is

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

2008-12-02 Thread Peter Ammon
On Dec 2, 2008, at 8:47 AM, Keith Blount wrote: The trouble is - unless I'm doing something wrong, which is likely - that -menuHasKeyEquivalent... doesn't seem to work like this; it seems to be an all or nothing deal. I can return NO, in which case none of the menus get populated. But if

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

2008-12-02 Thread Keith Blount
, too, or only the main menu? Thanks again and all the best, Keith --- On Tue, 12/2/08, Peter Ammon [EMAIL PROTECTED] wrote: From: Peter Ammon [EMAIL PROTECTED] Subject: Re: Rebuilding menus (menuNeedsUpdate:) and System Preferences keyboard shortcuts. To: [EMAIL PROTECTED] Cc: cocoa-dev

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

2008-12-02 Thread Peter Ammon
Context menus are not consulted when searching for key equivalents, unless they're actually open at the time, so you should not see the same problem. Also, all user key equivalents (what users can set in SysPrefs) are deliberately suppressed in context menus. This is because it would be

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

2008-12-02 Thread Keith Blount
Ammon [EMAIL PROTECTED] Subject: Re: Rebuilding menus (menuNeedsUpdate:) and System Preferences keyboard shortcuts. To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Date: Tuesday, December 2, 2008, 9:05 PM Context menus are not consulted when searching for key equivalents, unless they're

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

2008-12-01 Thread I. Savant
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

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

2008-12-01 Thread I. Savant
On Mon, Dec 1, 2008 at 4:36 PM, I. Savant [EMAIL PROTECTED] wrote: 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 say this like it is most

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

2008-12-01 Thread Peter Ammon
On Dec 1, 2008, at 12:49 PM, Keith Blount wrote: Hi, My application has several menus that get built dynamically, depending on user settings. For instance, there is a Styles menu, which lists styles the user has defined, and a Script Elements menu, which again, provides a list of

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

2008-12-01 Thread Keith Blount
Hi, Many thanks for the reply. If you implement menuHasKeyEquivalent:, then the menu does not get populated for matching key equivalents; NSMenu assumes that your code does not need it to be populated. This puts the onus of supporting user key equivalents on the app itself, and since

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

2008-12-01 Thread Keith Blount
: From: I. Savant [EMAIL PROTECTED] Subject: Re: Rebuilding menus (menuNeedsUpdate:) and System Preferences keyboard shortcuts. To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Date: Monday, December 1, 2008, 9:37 PM On Mon, Dec 1, 2008 at 4:36 PM, I. Savant [EMAIL PROTECTED] wrote

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

2008-12-01 Thread Peter Ammon
On Dec 1, 2008, at 2:17 PM, Keith Blount wrote: Hi, Many thanks for the reply. If you implement menuHasKeyEquivalent:, then the menu does not get populated for matching key equivalents; NSMenu assumes that your code does not need it to be populated. This puts the onus of supporting user