Re: Drag&Drop onto Button
Re: Drag&Drop onto Button
- Subject: Re: Drag&Drop onto Button
- From: Jeff Disher <email@hidden>
- Date: Thu, 6 Feb 2003 23:58:43 -0500
You should be able to sub-class the button and implement the drag &
drop at that level.
Here is a tutorial that describes implementing basic dragging
destination functionality. You _should_ be able to do the same thing
it does with your button:
http://cocoadevcentral.com/articles/000056.php
I haven't tried it, personally, but it seems like it should work,
Jeff.
On Thursday, February 6, 2003, at 11:19 PM, Mohit Gupta wrote:
Hi,
I am trying to drop onto a button. Unlike for tableView/outlineView, I
couldn't find any method like "validatedrop" and "acceptdrop" for a
button.
Thus I registered the whole window to accept the drop.
Task: To change the image of the button when the drag enters into it
and
revert back to the original image if the drag&Drop is
successful/unsuccessful.
-I tried using tracking rectangles to know if the mouse enters a
button,
however mouseEntered method doesn't get called(when you drag into a
button)
until the mouse is released.
-So I tried using the draggingEntered, the cursor location that I get
from
the draggingLocation method of the draggingInfo doesn't help, as the
drag
image enters the destination before the cursor does.
-Now I am using the draggingUpdated to get the new button-image, If the
drag happens the I can use performDragOperation to revert back to the
original image. If the drag does not happen then how do I revert back
to
the original image (the draggingExited is called only when the drag
leaves
the window, as the window is registered to accept drop).
am stuck on this...
Mohit
_______________________________________________
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.
Jeff Disher
President and Lead Developer of Spectral Class
Spectral Class: Shedding Light on Innovation
http://www.spectralclass.com/
_______________________________________________
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.