10.5 Only: If I say NO, NSOutlineView ignores cmd key, does its own thing
10.5 Only: If I say NO, NSOutlineView ignores cmd key, does its own thing
- Subject: 10.5 Only: If I say NO, NSOutlineView ignores cmd key, does its own thing
- From: Jerry Krinock <email@hidden>
- Date: Tue, 3 Jun 2008 20:57:31 -0700
I use an NSOutlineView. I have implemented an action, myAction, which
is targetted by a main menu item, which is in turn assigned the
keyboard shortcut cmd+upArrow.
In some situations, myAction is not allowed, so -validateMenuItem: in
my window controller subclass returns NO. I see that -
validateMenuItem: is invoked whenever the menu is displayed, and it is
also invoked whenever cmd+upArrow is typed.
When validateMenuItem: returns NO for myAction, the menu behaves as
expected: Item is disabled. And when I run my app in Mac OS 10.4.11,
the keyboard shortcut behaves as expected: NSBeep with no action.
But running in 10.5.3, upon typing cmd+upArrow, when -
validateMenuItem: returns NO, there is no NSBeep and instead a
different action happens: The selection is moved up. Of course, this
is the action that NSOutlineView normally performs in response to
upArrow without the cmd key modifier.
So, it's like NSOutlineView steps in and says, "So sorry he couldn't
do what you want, but here's a similar action of mine you might like!"
Is this a bug or a feature? I've read through the "Numerous
NSTableView and NSOutlineView enhancements" in the Leopard AppKit
Release Notes [1] but can't find this one.
Of course, my app is linked to the 10.4u SDK.
Jerry Krinock
[1] http://developer.apple.com/releasenotes/Cocoa/AppKit.html#NSTableView
_______________________________________________
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