Re: Drag and drop color swatches
Re: Drag and drop color swatches
- Subject: Re: Drag and drop color swatches
- From: email@hidden (Heinrich Giesen)
- Date: Wed, 8 Dec 2004 12:34:36 +0100
Hello ,
On 08.12.2004, at 07:29, Christopher Drum wrote:
The problem I'm having is with the
NSColorPboardType.
Your code is too complicated. I do not know why you declare
the NSStringPboardType and why you use an archiver. Since my
NeXTStep times I rarely needed an archiver. This is because
"the system" does it all for you. Try this:
NSColor *dragColor = [self color];
[pb declareTypes:[NSArray arrayWithObject:NSColorPboardType] owner:self];
[dragColor
<x-tad-bigger>writeToPasteboard:pb</x-tad-bigger>];
You read a color from the pasteboard with:
<x-tad-bigger>color = [NSColor colorFromPasteboard:</x-tad-bigger><x-tad-bigger>pasteBoard];</x-tad-bigger>
(See the docs for NSColor)
Heinrich Giesen
--
Heinrich Giesen
email: email@hidden
_______________________________________________
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