• 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
NSTextField and key-events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextField and key-events


  • Subject: NSTextField and key-events
  • From: Patrick Gundlach <email@hidden>
  • Date: Sat, 21 Jun 2003 17:56:56 +0200
  • Organization: privat

Dear cocoa developers,

I am new to this list and new to cocoa development.

I'd like to create an interface with IB. My goal is to get an
NSTextField-alike field, where I get the keys the user types in before
he/she presses enter but with visual feedback. So something like the
search field in iTunes or Address Book. These applications act before
the user presses the enter key on the keyboard.

My first attempt was to create a subclass of NSTextField, say
EventTextField. I took a NSTextField in IB from the palette
(Views->NSTextField) and changed in the information window (Custom
Class) the NSTextField to EventTextField. This had no effect on the
outcome of the final application (with just this text field): I
created an initWithFrame:frame constructor, but this did not get called.
Same with methods like acceptFirstResponder and keyDown:event.

So next try was to drag a CustomView (Cocoa-Containers) from the
palette and repeated the above (inside the custom view). This time the
initWithFrame initializer was called. So I implemented the method
acceptsFirstResponder that returns YES and keyDown:event, but the
latter one was never called.

What am I doing wrong? Am I heading in the right direction? Do I need
to change the fieldEditor? And how would I do this? Any hints? Or is
this question too trivial?

Patrick

(Bochum, Germany)
--
Silent is the goldfish in its bowl
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSTextField and key-events
      • From: Just van Rossum <email@hidden>
    • Re: NSTextField and key-events
      • From: Matt Gemmell <email@hidden>
    • Re: NSTextField and key-events
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: Best way to play a legacy "SystemSound" file in Cocoa?
  • Next by Date: Re: NSTextField and key-events
  • Previous by thread: Hundreds of unhelpful error messages! Help
  • Next by thread: Re: NSTextField and key-events
  • Index(es):
    • Date
    • Thread