• 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 NSButtonCell and NSTableColumn binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Custom NSButtonCell and NSTableColumn binding
      • From: Alexander Lamb <email@hidden>
References: 
 >Re: Custom NSButtonCell and NSTableColumn binding (From: Matt Neuburg <email@hidden>)
 >Re: Custom NSButtonCell and NSTableColumn binding (From: Michael Nickerson <email@hidden>)

  • Prev by Date: Re: Re: What's the fastest way to get icons for file/folders?
  • Next by Date: Re: What's the fastest way to get icons for file/folders?
  • Previous by thread: Re: Custom NSButtonCell and NSTableColumn binding
  • Next by thread: Re: Custom NSButtonCell and NSTableColumn binding
  • Index(es):
    • Date
    • Thread