Re: problem with Textfields
Re: problem with Textfields
- Subject: Re: problem with Textfields
- From: Mike Ferris <email@hidden>
- Date: Thu, 5 Dec 2002 09:55:15 -0800
One common way to solve this sort of problem is to have your button
action do a [window makeFirstResponder:window] prior to processing the
field content. This will cause any editing field to end editing and
send its action.
It is also sometimes desirabel to do this sort of thing on
windowWillClose: or windowDidResignKey: for things like Inspector
panels without OK buttons...
Mike Ferris
Begin forwarded message:
From: Patrice Goetghebeur <email@hidden>
Date: Thu Dec 5, 2002 9:32:59 AM US/Pacific
To: email@hidden
Subject: problem with Textfields
Hi,
I have a window with many NSTextField in a NSTabView. I created a
controller for each view. There is also a button at the bottom of the
window linked to the window controller.
I'd like to get all the values of the textfields in a shared object
when i press the button.
I created a method for each textfield that sends its content to the
shared object, then linked in IB each textfield to the respective
method.
My problem is: textfields send messages at end editing, that is when
we press enter or click elsewhere in the window, so my shared object
is not updated with the last textfield edited if i directly click on
the button.
Is there a way to order an update when clicking the button, or a
better way to do that ?
Thanks for your help.
Patrice.
_______________________________________________
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.