• 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: Custom Bindings clarification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom Bindings clarification


  • Subject: Re: Custom Bindings clarification
  • From: mmalcolm crawford <email@hidden>
  • Date: Tue, 27 Jan 2004 08:36:34 -0800

On Jan 27, 2004, at 7:46 AM, Peer Allan wrote:

I have been doing some research trying to find out how to add a binding to a NSTextField to allow me to set the background color based on the data being shown in the field. I found this post (http://cocoa.mamasam.com/COCOADEV/2003/12/1/79413.php) in the archive describing that one must subclass and create an IB palette to do what i want. I just want to verify with those in the know if this is what I should be looking at to accomplish my goal, or if I should be looking somewhere else?

If you just want to establish a binding, you can do it programatically:

[textField bind: @"backgroundColor" toObject: $sourceObject
withKeyPath: $backgroundTextColorKey options:nil];


The only reason to create a palette in this case is if you want to be able to make the connection in IB.

<http://cocoa.mamasam.com/COCOADEV/2003/12/2/79955.php>

mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Custom Bindings clarification
      • From: mmalcolm crawford <email@hidden>
References: 
 >Custom Bindings clarification (From: Peer Allan <email@hidden>)

  • Prev by Date: Re: String in hexadecimal
  • Next by Date: Re: Making a String from a non-NSString
  • Previous by thread: Custom Bindings clarification
  • Next by thread: Re: Custom Bindings clarification
  • Index(es):
    • Date
    • Thread