Re: Custom NSButtonCell and NSTableColumn binding
Re: Custom NSButtonCell and NSTableColumn binding
- Subject: Re: Custom NSButtonCell and NSTableColumn binding
- From: Corbin Dunn <email@hidden>
- Date: Fri, 18 Aug 2006 15:16:10 -0700
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];
}
For various reasons, I actually don't recommend this, since it means
what is set with setObjectValue: won't be the same thing that is
returned from objectValue. For example, you set the object value to an
array, but calling objectValue then gives back a string (or
something), which is very strange.
--corbin
_______________________________________________
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