Re: Changing draggedImage in mid-drag
Re: Changing draggedImage in mid-drag
- Subject: Re: Changing draggedImage in mid-drag
- From: "John C. Randolph" <email@hidden>
- Date: Sun, 16 Sep 2001 07:56:08 -0700
On Sunday, September 16, 2001, at 06:52 AM, Don McConnell wrote:
Hello ...
I want to have draggedImage change while being dragged, to
provide some specialized feedback in a game.
My first attempt was, within the 'draggingUpdated' method,
to lockFocus on the draggedImage, draw in my changes, and
then unlockFocus. Nothing appears to happen (perhaps because
I lack of the conceptual equivalent of NSView's 'display' to
update the draggedImage image?).
After you update the image, you still have to tell whatever view is
displaying that image to redraw itself.
In NeXTSTEP, dragging was implemented with a transparent window into
which the dragged image was drawn. I would get hold of the dragging
window, and send a -display message to its contentview. I'm not seeing
a way to get hold of that window in Cocoa, though.
Maybe if you implement -draggedImage:movedTo: method in your dragging
source, you can alter the image there.
-jcr
"We have awakened the Sleeping Giant" -Admiral Isoroku Yamamoto, Dec 7,
1941.