Re: Binding button.enabled to "NSTextField is not empty"
Re: Binding button.enabled to "NSTextField is not empty"
- Subject: Re: Binding button.enabled to "NSTextField is not empty"
- From: Ricky Sharp <email@hidden>
- Date: Tue, 26 Apr 2005 10:35:55 -0500
On Tuesday, April 26, 2005, at 08:25AM, Johnny Deadman <email@hidden> wrote:
>you either need to subclass or add a category to NSTextField which has a
>
>-(BOOL) isEmpty
>
>method.
>
>You then need to set 'isEmpty' whenever the status of the textfield
>changes.
>
>You then create an NSObjectController to control the textfield object.
>
>You can then bind your button's 'enabled' binding to the textfield's
>'isEmpty' property via the controller.
While I agree that this would be the cool way to do things, you could also take a non-binding approach and implement the textDidChange: delegate method. The NSControlTextDidChangeNotification will then give you access to the field editor's cell which you can in turn see if it contains text or not.
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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