Re: Recognizing return/enter in TextField
Re: Recognizing return/enter in TextField
- Subject: Re: Recognizing return/enter in TextField
- From: Douglas Davidson <email@hidden>
- Date: Tue, 30 Apr 2002 11:46:42 -0700
On Tuesday, April 30, 2002, at 08:20 AM, Donald Brown wrote:
I've got a search TextField in a toolbar, where the user presses
return, my
document (which is a delegate of the textfield) sees
controlDidEndEditing,
finds the relevant area, and highlights it. The problem is that when
the
text field is no longer key, it sends again controlDidEndEditing, which
means it finds the second occurrence of the item. I tried subclassing
NSTextField to override keydown, but it's never called.
I would think the natural thing would be to use target/action methods
for this, rather than end-editing notifications. If you really need to
know exactly what is happening in your text field, then you can use
delegate methods; for example, control:textView:doCommandBySelector:
with @selector(insertNewline:) indicates that return has been pressed.
Douglas Davidson
_______________________________________________
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.