DragDropImageView
DragDropImageView
- Subject: DragDropImageView
- From: Lorenzo <email@hidden>
- Date: Tue, 09 Sep 2003 00:11:03 +0200
Hi,
I took this sample code from Apple. The name of the sample is
DragDropImageView. I wanted to implement it but it has a bug.
Is the 3rd time I ask here, but nobody replys to me.
Is anyone can help me to solve this bug?
If I drag an NSImage from the NSImageView onto a TextEdit document
or onto an Entourage HTML email, everything works fine.
But if I drag the *same* image to the Finder, the Finder freezes.
And if I drag the *same* image onto a Photoshop document, my application
quits unexpectedly. May you please explain me why? Here's the code.
Any help would be appreciated. Thank you.
----------------------------------------------------------------------
----------------------------------------------------------------------
- (void)pasteboard:(NSPasteboard *)sender provideDataForType:(NSString
*)type
{
if([type compare: NSTIFFPboardType] == NSOrderedSame){
[sender set
Data:[theImage TIFFRepresentation] forType:type];
}
else if([type compare: NSPDFPboardType] == NSOrderedSame){
[sender set
Data:[self dataWithPDFInsideRect:[self bounds]]
forType:type];
}
// I addes the following, but it freezes the same
else [sender setData: nil forType:type];
[self unregisterDraggedTypes];
isDragging = NO;
}
----------------------------------------------------------------------
----------------------------------------------------------------------
Also, I don't understand why, when quit, the routine above is being called
hundreds of times. It should be called once only (just to let the user copy,
quit and paste to other applications). No?
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.