Re: Custom NSButtonCell and NSTableColumn binding
Re: Custom NSButtonCell and NSTableColumn binding
- Subject: Re: Custom NSButtonCell and NSTableColumn binding
- From: Michael Nickerson <email@hidden>
- Date: Fri, 18 Aug 2006 14:29:03 -0400
On Aug 18, 2006, at 12:10 PM, Matt Neuburg wrote:
On Fri, 18 Aug 2006 12:15:35 +0200, Alexander Lamb <email@hidden>
said:
Hello list,
I searched the list and other sites. Many people seem to have the
same question but none found the answer. So here it goes:
I have a custome NSButtonCell: an LSColorCheckCell which in addition
to having a state ,has a color (checkColor).
Do you understand how to write the back end for a full-fledged custom
binding? (mmalc's GraphicsBinding example shows you the sort of
thing you
must be prepared to do.) If not, you might be happier setting the
color in
some other way, e.g. thru tableView:willDisplayCell:.... m.
Alternately, you could override -setObjectValue: in your NSButtonCell
subclass to do your setup for you. In your modal data, return an
array containing the state and the color, then in -setObjectValue: do
something like this: (Note, typed in Mail, not tested)
- (void)setObjectValue:(id <NSCopying>)aValue
{
if ( [aValue isKindOfClass:[NSArray class]] ) {
[super setObjectValue:[aValue objectAtIndex:0]]; //the state
[self setCheckColor:[aValue objectAtIndex:1]]; //your color
} else {
[super setObjectValue:aValue];
}
(Special note: I haven't used bindings with a table/outline view as
of yet, so if anyone knows for sure this won't work, i.e. -
setObjectValue: isn't used or some such, do correct me.)
Darkshadow
(aka Michael Nickerson)
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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