Hi Sean!

> Do I remember correctly that you're trying to make a cell version of
> NSColorWell, so that you can use it in a table?

Yes, this (screenshot from my app) :

<<inline: Capture d’écran 2010-11-20 à 20.00.42 .png>>



> I tried that a few months ago, and got something basically working (with
> Corbin's help), but never did get it working very generally.  I haven't
> got back to it, but there were issues with resorting the table, removing/
> reordering columns, etc.

Ha. I guess I am more or less at the same point as you. The cells display 
correctly, I can click on one, it open the NSColorPanel, I can alter the color. 
The table is filled through a data provider, not bindings, because I have to do 
a lot of work in case of modification (e.g. if the user alters the 86 at the 
second row to 90, the 86 of the third row should change also).

> 
>> For example, I can't figure out the way copyWithZone: in ATColorCell.m
>> works. But I picked up the idea of -hitTestForEvent.
> 
> Supporting NSCopying in NSCells is annoying because NSCell uses
> NSCopyObject.  You can read more here:

Yes, that I knew, because it is mentioned explicitly in the documentation 
("override CopyWithZone if you have iVar objects because the default 
implementation just copies pointers"). Fortunately, my custom cell has only one 
iVar which is its NSColor, so it does not too intricate!

Slàn !
Vincent
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to