• 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 NSCell and target/action
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

PNG image



> 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

  • Follow-Ups:
    • Re: Custom NSCell and target/action
      • From: vincent habchi <email@hidden>
References: 
 >Custom NSCell and target/action (From: Vincent Habchi <email@hidden>)
 >Re: Custom NSCell and target/action (From: Graham Cox <email@hidden>)
 >Re: Custom NSCell and target/action (From: Vincent Habchi <email@hidden>)
 >Re: Custom NSCell and target/action (From: Corbin Dunn <email@hidden>)
 >Re: Custom NSCell and target/action (From: vincent habchi <email@hidden>)
 >Re: Custom NSCell and target/action (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: Custom NSCell and target/action
  • Next by Date: Re: Custom NSCell and target/action
  • Previous by thread: Re: Custom NSCell and target/action
  • Next by thread: Re: Custom NSCell and target/action
  • Index(es):
    • Date
    • Thread