NSTextField and key-events
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.