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: Johnny Deadman <email@hidden>
- Date: Tue, 26 Apr 2005 09:24:36 -0400
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.
On 26-Apr-05, at 1:22 AM, Andrew White wrote:
I have a button. In the same window, I have a text field. I want
the button's 'enabled' state to track the whether the text field is
non-empty (you can only click the button if the text field has
something in it).
_______________________________________________
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