Hello everyone,
I'd like to implement drag and drop functionality for my application, but what I want is for the icon of the dragged item to appear on the screen at the position in which I let go of the mouse. For example, I want to drag a zip file and have the Finder zip icon appear on my subclassed NSView in the position where I released my mouse.
Now, I figured out how to get the Finder icon image by doing:
imageToDraw = [[NSWorkspace sharedWorkspace] iconForFile:fileLocationOnDisk];
But how do I get the co-ordinates of the mouse when the drag ended? I've tried draggedImageLocation in performDragOperation:, I've tried updating a NSPoint with the mouse co-ordinates using mouseDrag:, but not of this seems to work.
Is there anyone who can assist with this problem? I'd be very grateful.
Thanks in advance,
David Gill
I'd like to implement drag and drop functionality for my application, but what I want is for the icon of the dragged item to appear on the screen at the position in which I let go of the mouse. For example, I want to drag a zip file and have the Finder zip icon appear on my subclassed NSView in the position where I released my mouse.
Now, I figured out how to get the Finder icon image by doing:
imageToDraw = [[NSWorkspace sharedWorkspace] iconForFile:fileLocationOnDisk];
But how do I get the co-ordinates of the mouse when the drag ended? I've tried draggedImageLocation in performDragOperation:, I've tried updating a NSPoint with the mouse co-ordinates using mouseDrag:, but not of this seems to work.
Is there anyone who can assist with this problem? I'd be very grateful.
Thanks in advance,
David Gill