Temporarily disable button key equivalent
Temporarily disable button key equivalent
- Subject: Temporarily disable button key equivalent
- From: Eric Crichlow <email@hidden>
- Date: Sat, 6 Nov 2010 14:26:49 -0700 (PDT)
I have a data entry sheet that has the Return key set as the key equivalent for the OK button, to dismiss the sheet.
The sheet has a couple of NSComboBox controls on it.
When the combobox dropdown is showing, I want the user to be able to use the arrow keys to pick an item and hit the Return key to choose the item without that triggering the OK button and closing the sheet.
So, in the comboBoxWillPopUp notification I set the button's key equivalent to @"".
Works great.
Then, in the comboBoxWillDismiss notification, I set the key equivalent back to @"\r".
Unfortunately, when I do this, the OK button still gets activated by the Return key the user entered to select a combobox item.
I tried moving the call to re-enable the key equivalent to the textDidEndEditing notification for the combo box, but the problem persists.
Where/when can I re-enable the key equivalent to avoid this problem?
...Eric...
Company site: http://www.infusionsofgrandeur.comDeveloper Blog: http://www.onelazyprogrammer.com
_______________________________________________
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