Re: Custom Bindings clarification
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.