• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Binding button.enabled to "NSTextField is not empty"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Binding button.enabled to "NSTextField is not empty"
      • From: mmalcolm crawford <email@hidden>
    • Re: Binding button.enabled to "NSTextField is not empty"
      • From: Ricky Sharp <email@hidden>
References: 
 >Binding button.enabled to "NSTextField is not empty" (From: Andrew White <email@hidden>)

  • Prev by Date: Re: Drawing on a QuickTime movie
  • Next by Date: Re: determining front most document?
  • Previous by thread: Re: Binding button.enabled to "NSTextField is not empty"
  • Next by thread: Re: Binding button.enabled to "NSTextField is not empty"
  • Index(es):
    • Date
    • Thread