• 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
What is the way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What is the way


  • Subject: What is the way
  • From: Christophe ANDRES <email@hidden>
  • Date: Fri, 3 May 2002 09:23:10 +0100

Hi,

I have a little problem that is stumbling me since quite some time now, if someone can shed some light on the issue.

I have a series of NSTextField with also a NSComboBox that are used for data entry, and an <Add> button (default button) that collects the data from the fields and stores them away.
When the user clicks on the <Add> button, there is no problem the data is collected and the first field is made the FirstResponder.
On the other hand, when the user uses the <Enter> key, the data is collected, but the FirstResponder remains in the last edited field. I surronded the [window makeFirstResponder:aView] call with [window display] to see what is going on and I see that the field I want to BECOMES FirstResponder and then it switches back to the last edited field.

I suppose that this happens, because the <Enter> key is handled from within -[NSTextField textDidEndEditing:] (as seen from the stack trace), which seems to reset the FirstResponder.
I tried to move the FirstResponderit to a notification, but obviously the notification gets handed immediately, still within the context of -[NSTextField textDidEndEditing:].

So how am I supposed to handle such a (IMHO) common case?
Do I have to fire up a NSTimer to get out of that call chain, or is there another method?

Thanks for your insight.
Christophe ANDRES
_______________________________________________
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.

  • Prev by Date: Re: NSLog to a file?
  • Next by Date: Re: source for Terminal?
  • Previous by thread: Re: NSLog to a file?
  • Next by thread: Cocoa proto-app will not run on another computer
  • Index(es):
    • Date
    • Thread