Re: Continous updates from NSForm
Re: Continous updates from NSForm
- Subject: Re: Continous updates from NSForm
- From: Derrick Bass <email@hidden>
- Date: Tue, 15 Nov 2005 22:58:52 -0800
On Nov 14, 2005, at 6:26 PM, I wrote:
I want to be able to update the enabled state of a button
continuously as the user types in an NSForm. (I.e. when the data is
valid, the "Okay" button is instantly enabled.) Is there a way to
get NSForm to send its action on every keypress, paste, etc? Or is
there another way to accomplish what I want to do?
Well, I still have no idea how to do this manually, but Cocoa
Bindings can do it. I connected (or do I say "bound"?) the NSForm to
keys in my model and connected the button to a method called
questionAnswerValid and then put this in the initialize method:
[self setKeys:[NSArray arrayWithObjects:@"question",@"answer",nil]
triggerChangeNotificationsForDependentKey:@"questionAnswerValid"];
Derrick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden