• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Intercepting keyDown event from NSComboBox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intercepting keyDown event from NSComboBox


  • Subject: Re: Intercepting keyDown event from NSComboBox
  • From: John Stiles <email@hidden>
  • Date: Wed, 13 Feb 2008 09:37:26 -0800

OK, I looked at this a little more closely because I was curious and it is probably an issue I will eventually need to grapple with as well :) Recently, if there's a nonstandard way of doing things, I've been having to do it!

So the root issue is this: there is a -keyDown: event being generated, but the combo box isn't the receiver. The receiving object is the field editor!

There are technotes on returning a custom field editor which you can look at. All you really need to do is subclass NSTextView and implement a -keyDown: or -insertText: in your subclass, then provide that text view as the field editor for the combo box. That should solve it.

Good luck.


Randall Meadows wrote:
On Feb 12, 2008, at 7:18 PM, John Stiles wrote:

You can subclass NSComboBox and override -keyDown: or -insertText:.

Well, I didn't try insertText:, but keyDown did not ever get called.
_______________________________________________

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


  • Follow-Ups:
    • Re: Intercepting keyDown event from NSComboBox
      • From: "Kyle Sluder" <email@hidden>
References: 
 >Intercepting keyDown event from NSComboBox (From: Randall Meadows <email@hidden>)
 >Re: Intercepting keyDown event from NSComboBox (From: Graham <email@hidden>)
 >Re: Intercepting keyDown event from NSComboBox (From: John Stiles <email@hidden>)
 >Re: Intercepting keyDown event from NSComboBox (From: Randall Meadows <email@hidden>)

  • Prev by Date: Re: Adding obj-c++ file to carbon project changes preprocessed header file types -- NSCursor mouse glitches
  • Next by Date: Re: NSView -drawRect optimization
  • Previous by thread: Re: Intercepting keyDown event from NSComboBox
  • Next by thread: Re: Intercepting keyDown event from NSComboBox
  • Index(es):
    • Date
    • Thread