On 14/06/2010, at 9:50 PM, Chaitanya Pandit wrote:

> I'm observing a very weird behavior with NSDraggingInfo, I have a NSTextView 
> subclass where i have implemented dragging.
> When i drag an image from safari and drop it in the textView and try to 
> access the draggedImage from the supplied <NSDraggingInfo>sender, it returns 
> nil.
> Also, the point that "draggedImageLocation:" method returns when converted to 
> the textView's coordinates, is not exactly where the origin of the dragged 
> image was.


This is normal.

If the image was dragged from outside your app, you can't access the image 
(remember, the image is just a proxy for some data that is what is really being 
moved between the apps, so the image itself is of no use to the receiver of the 
drag, only the data is). The documentation isn't explicit on this point (file 
bugs) but I took this to be common knowledge, though where it came from I 
really don't know.

The co-ordinate of draggedImageLocation: is the lower left corner of the image, 
not the mouse point which is what you might be assuming. Again though, it 
should not be important to the receiving app - what is important is the 
-draggingLocation:, i.e. the mouse position.

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to