Re: Drag-to-poof and tables
Re: Drag-to-poof and tables
- Subject: Re: Drag-to-poof and tables
- From: Graham Cox <email@hidden>
- Date: Tue, 3 Jun 2008 10:26:52 +1000
I realised after I posted this that of course in this situation you
don't *have* a receiving view which can manipulate the return value.
I had a look at an old piece of code that I thought was doing
something similar and it turns out it's not quite the same - in my
case I'm dragging something within a view without using the dragging
protocol, and if it's dragged outside (which deletes it with a 'poof')
I just fake it using a semi-transparent cursor image.
So I'm afraid I don't know - plenty of apps can do it though (i.e.
dragging off a toolbar item) so presumably some combination of
settings should work. I need to solve this myself in one of my apps so
if I figure it out I'll let you know.
G.
On 3 Jun 2008, at 9:36 am, Graham Cox wrote:
I forget the exact details, (if I get more time I'll look them up
for you) but instead of passing NO to slideback, pass YES, then be
smarter about what you return from the drag receiver. A drop outside
the table is a valid target in your design, so you should say so -
return something other than NSDragOperationNone. The sender then
won't show the slideback because the receiver did something with the
drag (even if it was just a deletion).
hth,
G.
On 3 Jun 2008, at 7:09 am, Tomas Franzén wrote:
Hi,
I'm trying to figure out the best way to implement a scenario where
there's a table where the user can drag rows to reorder (the easy
part) but also drop them outside of the table to remove items with
a poof. The way we do it now is to use slideBack:NO and implement
draggedImage:endedAt:operation: and checking for
NSDragOperationNone and determining if the cursor was outside of
the table view. And if so, do the poof. This sorta-kinda works, but
has some downsides. The drag image never slides back. This is fine
when there's a poof, but not when the drag was ended with
NSDragOperationNone inside of the table. Also, this poofs if the
user presses the escape key, since that also sends
NSDragOperationNone, which is horrible.
This way just feels like a dirty hack. There must be a better way.
How have you implemented it in your own apps?
Thanks!
Tomas Franzén
Lighthead Software
http://www.lightheadsw.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden