Re: Doc-based app, text fields, and losing focus
Re: Doc-based app, text fields, and losing focus
- Subject: Re: Doc-based app, text fields, and losing focus
- From: Public Look <email@hidden>
- Date: Tue, 25 Nov 2003 19:34:49 -0500
-controlTextDidEndEditing:
Handles an end of editing NSNotification aNotification. After
validating the new value, posts
anNSControlTextDidEndEditingNotification to the default notification
center. This posting causes the receivers delegate to receive
acontrolTextDidEndEditing: message. After this message, sends
endEditing: to the receiver cell and handles the key that caused
editing to end:
If the user ended editing by pressing Return, this method tries to
send the receivers action to its target; if unsuccessful, it
sendsperformKeyEquivalent: to its NSView (for example, to handle the
default button on a panel); if that also fails, the receiver simply
selects its text.
If the user ended editing by pressing Tab or Shift-Tab, the
receiver tries to have its NSWindow select its next or previous key
view, using the NSWindow method selectKeyViewFollowingView: or
selectKeyViewPrecedingView:. If unsuccessful in doing this, the
receiver simply selects its text.
See the NSControl class specification for more information on the text
delegate method.
See Also: textShouldBeginEditing:, textDidBeginEditing:,
textDidChange:, textShouldEndEditing:
On Nov 25, 2003, at 2:10 PM, James Mcconnell wrote:
>
Hi all. I have a doc-based app. On this I have several text fields.
>
What I would like to do is to monitor when focus is lost on a text
>
field, I want to check to see if the field is empty. If so, I want a
>
dialog to prompt the user to enter a value. Basically, I want to make
>
sure every field is filled in.
>
>
I know I can use notifications and NSAlert and all of that, but I
>
don't know how to catch it when focus moves to another text field. I
>
have 5 NSTextFields, and 2 NSTextViews.
>
>
So, how would I go about catching focus lost on a text field? Just a
>
push in the right direction is all I ask. If anyone knows of any
>
tutorials, that would be cool too.
>
>
James
>
_______________________________________________
>
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.
_______________________________________________
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.