Re: How to set focus on NSMenu (make it get key events)?
Re: How to set focus on NSMenu (make it get key events)?
- Subject: Re: How to set focus on NSMenu (make it get key events)?
- From: Kyle Sluder <email@hidden>
- Date: Fri, 27 Aug 2010 08:27:56 -0400
On Aug 27, 2010, at 3:34 AM, Nava Carmon <email@hidden> wrote:
> Hi,
>
> I have a status menu with a NSSearchField and menu items. When search field is active and user presses up & down arrows, I'd like to start menu tracking, that is that the user will be able to move with arrow keys between menu items. I can catch moveUp and moveDown selectors. How can I cause the menu to become a key responder?
You've asked essentially the same question three times now in the past few days. In your first posting, you acknowledged that this topic has been discussed on the list recently and the conclusion was to not use NSMenu. Yet you do not want to heed this advice.
There is simply no way to do what you want to do using NSMenu. You must use a custom borderless window. I'm sorry you started down the path of using NSMenu and must now throw out that code—it was a logical first step, and one that many others, including myself, have taken and encountered the same problems as you.
But you cannot remain attached to your existing code. It will never do what you need, and therefore keeping it around has no value to you. Right now you are exhibiting what economists refer to as the sunk cost fallacy: you're concerned about the effort you've already invested in the NSMenu solution, when there's nothing you can do about that. What you need to be thinking about is what can come from continuing to invest additional effort into your current approach—the answer, of course, is nothing.
--Kyle Sluder_______________________________________________
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