Re: Custom NSCell and target/action
Re: Custom NSCell and target/action
- Subject: Re: Custom NSCell and target/action
- From: vincent habchi <email@hidden>
- Date: Sat, 20 Nov 2010 20:14:02 +0100
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) :
> 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 (email@hidden)
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:
This email sent to email@hidden