Drag Image Freezes
Drag Image Freezes
- Subject: Drag Image Freezes
- From: Lorenzo <email@hidden>
- Date: Mon, 08 Sep 2003 01:53:55 +0200
Hi,
if I drag an NSImage from the NSImageView onto a TextEdit document
everything works fine.
If I drag the same image to the Finder, the Finder freezes.
If I drag the same image onto a Photoshop document, my application quits.
May you please explain me why? Here's the code.
- (void)pasteboard:(NSPasteboard *)sender provideDataForType:(NSString
*)type
{
NSLog(@"isDragging %d", isDragging);
if(!isDragging) return;
//sender has accepted the drag and now we need to send the data for the
type we promised
if([type compare: NSTIFFPboardType] == NSOrderedSame){
NSLog(@"set data for TIFF");
[sender set
Data:[theImage TIFFRepresentation] forType:type];
}
else if([type compare: NSPDFPboardType] == NSOrderedSame){
NSLog(@"set data for PDF");
[sender set
Data:[self dataWithPDFInsideRect:[self bounds]]
forType:type];
}
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.