How to implement "drag out of Dock to remove"-behavior?
How to implement "drag out of Dock to remove"-behavior?
- Subject: How to implement "drag out of Dock to remove"-behavior?
- From: Allan Odgaard <email@hidden>
- Date: Fri, 12 Mar 2004 18:52:05 +0100
I show a list of items and allow for the user to interact with these
items. One of the ways he can interact is to drag "away" the items to
remove them from the list -- similar to how one can drag icons away
from the dock or the standard toolbars.
I have faced two problems:
1) I want to use the 'disappearing item' cursor, but if the mouse
enters/leaves a window (while dragging), then NSCursor goes back to the
default arrow cursor. My solution is to (continuously) set the
'disappearing item' cursor in draggedImage:movedTo:, but would like to
learn if an alternative exists.
2) The image should slide back if not dragged far enough away from the
list, but otherwise show the 'disappear animation'. My problem here is
that if I provide slideback:YES when starting the drag, the image will
always slide back (if the drag target did not accept the drop, which it
does not do if e.g. dropped outside my window). But if I provide
slideback:NO, setup my view to accept drops and call
slideDraggedImageTo: (of the dragging source) in my
prepareForDragOperation: (as the documentation says), then nothing
happens. It seems that this slide-back method does not have an
implementation -- the documentation is also in conflict, in that
prepareForDragOperation: is said to be called *after* the image has
been released (so it would be too late to slide it back). Is there
anyway I can selectively slide back the dragged image?
_______________________________________________
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.