• 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: Bind button avail to edit field content
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bind button avail to edit field content


  • Subject: Re: Bind button avail to edit field content
  • From: Mike Abdullah <email@hidden>
  • Date: Thu, 17 Aug 2006 17:00:01 +0100

Um, this all seems a little complicated. Just bind the "Enabled" key of the button to the same key that you are binding the text field to and use the NSIsNotNil value transformer.

Mike.

On 17 Aug 2006, at 12:16, Chris Suter wrote:

On 17/08/2006, at 6:47 PM, Trygve Inda wrote:
Is there a way to bind a buttons enable status to an edit field such that if
the field is empty, the button is disabled, but if it has any content the
button is enabled?

It's possible. One way that works (and someone with more bindings experience can probably offer a more elegant solution) is to instantiate an NSMutableDictionary and an NSObjectController in your NIB file. Then bind your edit control to a key in your dictionary via the object controller and then you'll be able to bind the enabled setting for the button. I'm not sure whether it's a good idea to do it this way.


- Chris

<MainMenu.nib.zip>


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden

_______________________________________________ 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: 
 >Bind button avail to edit field content (From: Trygve Inda <email@hidden>)
 >Re: Bind button avail to edit field content (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Rotating an object
  • Next by Date: NSTextFieldCell Subclass in IB
  • Previous by thread: Re: Bind button avail to edit field content
  • Next by thread: Hidden NSButtonCells in a tableview
  • Index(es):
    • Date
    • Thread