• 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: Recognizing return/enter in TextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Recognizing return/enter in TextField (From: Donald Brown <email@hidden>)

  • Prev by Date: Re: Refresh woes for custom OGL pane
  • Next by Date: Re: Help Viewer issue
  • Previous by thread: Recognizing return/enter in TextField
  • Next by thread: Cocoa Applications
  • Index(es):
    • Date
    • Thread