Re: Adding an NSColor subclass to NSColorPanel?
Re: Adding an NSColor subclass to NSColorPanel?
- Subject: Re: Adding an NSColor subclass to NSColorPanel?
- From: Timothy Wood <email@hidden>
- Date: Thu, 31 Jul 2008 20:29:09 -0700
On Jul 31, 2008, at 2:20 PM, David Springer wrote:
I would like to add instances of a subclass of NSColor to the color
panel. The problem is, when you change to another app that does not
know about this subclass, the NSColorPanel kind of freaks out and
shows all the colors as white (even the system colors) - in some cases
it just crashes the other app. Is there a way I can tell NSColorPanel
to add my special colors only for my app, and not affect other apps?
The problem goes a bit deeper. At least in the past, if the user
puts
a custom colors on the palette of colors, it would get archived and will
other apps may raise/crash trying to unarchive load the color list from
~/Library/Colors/NSColorPanelSwatches.plist. If you do this, it would
be good to make sure your colors *archive* themselves as normal colors,
possibly using -replacementObjectForArchiver:, substituting a stock
color.
-tim
_______________________________________________
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