Re: Accepting image drags from Safari & Firefox
Re: Accepting image drags from Safari & Firefox
- Subject: Re: Accepting image drags from Safari & Firefox
- From: Steven Kramer <email@hidden>
- Date: Mon, 6 Jun 2005 18:38:48 +0200
Op 6-jun-05 om 3:14 heeft Andreas Mayer het volgende geschreven:
Am 3. Jun 2005 um 18:25 Uhr schrieb Jonathan del Strother:
I'm having trouble finding a way that reliably works for all
situations (eg when the image is surrounded by link tags, I get the
link destination rather than the image URL)
I don't see this problem.
How would you get a link from the pasteboard if you are looking for an
image?
This seems to work for me:
I use the same, but a bit shorter (may be Panther only...)
// register for image+filename drag types
NSMutableArray* types = [[[NSImage imagePasteboardTypes] mutableCopy]
autorelease];
[types addObject: NSFilenamesPboardType];
[self registerForDraggedTypes: types];
// in draggingEntered et al
if ([[sender draggingPasteboard] availableTypeFromArray: [NSArray
arrayWithObject: NSFilenamesPboardType]] && (operation &
(NSDragOperationLink | NSDragOperationCopy))) {
...
}
else if ([NSImage canInitWithPasteboard: [sender draggingPasteboard]]
&& (operation & NSDragOperationCopy)) {
...
}
Regards,
Steven Kramer
--
email@hidden
http://www.sprintteam.nl/
_______________________________________________
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