Re: Getting NSTextField from NSWindow firstResponder
Re: Getting NSTextField from NSWindow firstResponder
- Subject: Re: Getting NSTextField from NSWindow firstResponder
- From: Ed Watkeys <email@hidden>
- Date: Sat, 29 Nov 2003 21:41:40 -0500
On Nov 29, 2003, at 5:05 PM, James Spencer wrote:
On Nov 29, 2003, at 3:14 PM, Ed Watkeys wrote:
To restate and clarify: since r refers to the shared NSTextView,
making it the first responder is doing nothing constructive. I need a
way to get from the NSTextView to the NSTextField, so I can put focus
back on the UI object that had focus before I called
setFirstResponder:. Any help would be appreciated.
I'm probably missing something but why go through all of this. Why
not just implement controlTextDidBeginEditing: or some other
appropriate delegate method in the delegate and get the relevant field
out of the notification. If for some reason that won't work, then
install your own text view as the field editor for any fields that you
need this information for; you aren't forced to use the shared field
editor.
Using controlTextDidBeginEditing: is a good idea, although, as I noted
to Stiphane Sudre in private e-mail about a similar suggestion, I would
need to check the class of the object returned by firstResponder, as
NSTableView and other objects do not use the field editor.
I'd rather come up with another, more elegant, approach and re-write
most of my UI than start messing with the field editor; this is
beginning to seem like a kludge.
Thanks,
Ed
_______________________________________________
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.