• 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: 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

  • Follow-Ups:
    • Re: Custom NSButtonCell and NSTableColumn binding
      • From: Corbin Dunn <email@hidden>
References: 
 >Re: Custom NSButtonCell and NSTableColumn binding (From: Matt Neuburg <email@hidden>)

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