Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom Bindings clarification



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.

References: 
 >Custom Bindings clarification (From: Peer Allan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.