• 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: 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

References: 
 >Binding button.enabled to "NSTextField is not empty" (From: Andrew White <email@hidden>)
 >Re: Binding button.enabled to "NSTextField is not empty" (From: Johnny Deadman <email@hidden>)

  • Prev by Date: Re: unbordered nscombobox are drawn 4 pixels below
  • Next by Date: Re: unbordered nscombobox are drawn 4 pixels below
  • 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