Re: submit textfield without pressing ener
Re: submit textfield without pressing ener
- Subject: Re: submit textfield without pressing ener
- From: Tim Isted <email@hidden>
- Date: Fri, 5 Sep 2008 19:44:15 +0100
Depending on how you're implementing your login dialog, if you have a
method that is called when the ok button is clicked and you have
IBOutlets for the text field or the login dialog itself, in that
method you can either:
a) call [theTextField commitEditing]; on the text field or
b) call [loginWindow makeFirstResponder:nil];
The second way will take first responder status away from any
currently uncommitted text field editor (ie the current first
responder) and force it to commit its editing without you having
explicity to call commitEditing on that text field (and any other text
fields that might currently have un-committed data like a username
field etc).
Hope that helps,
Tim
On 5 Sep 2008, at 19:12, Ronnie B wrote:
Hi All.
I have a login dialog with a text field for password and OK and Cancel
buttons. But, unless I hit Enter key, the text field value does not
get
submitted. What can I do to have it working only with the OK buttons,
Thanks,
R.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden