Avoiding flicker when dropping in a view
Avoiding flicker when dropping in a view
- Subject: Avoiding flicker when dropping in a view
- From: Serge Meynard <email@hidden>
- Date: Fri, 11 Mar 2005 18:40:56 -0500
Greetings!
I have a custom view that contains various objects, and I have
implemented drag-and-drop to allow me to move them around. When I start
dragging a selected object, I stop displaying it in my drawRect: method
and let the drag-and-drop system handle drawing it in overlay. All this
works just fine. The problem comes when I drop the object... The
drag-and-drop code removes the overlay BEFORE I get any drop callbacks,
and as a result there is an annoying flicker before I get a chance to
redraw the object in its new position (which is exactly where the
overlay was being displayed only a moment before). Before I fully
understood that bit, I had tried a few workarounds, but obviously none
of them worked; the best I was able to do was to minimize the flicker's
duration.
Before I start considering any seriously inelegant bits of code to work
around this problem, does anyone have any (clean) suggestions?
Obviously, the point here is to act only when the drop occurs; anything
else would invalidate the whole point of the OS managing an overlay for
me! And no, I don't want to roll my own drag-and-drop code; the objects
can be dragged from one window to another within the app so it's not
entirely trivial. If I have to choose, I prefer living with a bit of
flickering to reinventing the wheel.
Thanks,
Serge
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden