Re: NSTableView and dragging cursor
Re: NSTableView and dragging cursor
- Subject: Re: NSTableView and dragging cursor
- From: Jim Correia <email@hidden>
- Date: Fri, 11 Nov 2005 20:24:55 -0500
On Nov 11, 2005, at 8:13 PM, Ken Victor wrote:
Look at the draggingSourceOperationMask in the dragging info. If
it contains NSDragOperationCopy and all other conditions are
appropriate for making a copy, return NSDragOperationCopy.
but this doesn't! my source allows copy and move and i was/am
relying on the presence or absence of the option key as to whether
or not it should be a copy or a move. thus, i believe examining the
draggingSourceOperationMask is not sufficient, but it is necessary
to determine the state of the option key as well as the state of
the draggingSourceOperationMask.
or am i still confused? :-)
This is one of those times where it is useful to both re-read the
documentation (I often miss the important sentence the first few
times through) and build a test app to see what is going on. If I had
a nickel for every throw away test app I've written... :-)
- (NSDragOperation)draggingSourceOperationMask
[...]
If the user is holding down a modifier key during the dragging
session and the source does not prohibit modifier keys from
affecting the drag operation (through its
ignoreModifierKeysWhileDragging method), then the operating system
combines the dragging operation value that corresponds to the
modifier key (see the descriptions below) with the source’s mask
using the C bitwise AND operator.
So, if the source permits copy and move, and the option key is down,
you'll see copy in the draggingSourceOperationMask when the option
key is down.
One of the gotchas here is that historically command+option mean link
in the Finder (and may be what users have come to expect) but Cocoa
defines link as control.
Jim
_______________________________________________
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