Re: NSTableView and dragging cursor
Re: NSTableView and dragging cursor
- Subject: Re: NSTableView and dragging cursor
- From: Ken Victor <email@hidden>
- Date: Fri, 11 Nov 2005 16:13:14 -0800
for the archives (i stumbled across this right after my posting):
in the table source's
tableView:validateDrop:proposedRow:proposedDropOperation: method, you
can check the option key via:
(([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask) != 0)
however, i'm still a little curious as to why this behavior doesn't
happen automatically... ie, did i misread the documentation? (likely)
or is the documentation wrong?
ken
At 3:55 PM -0800 11/11/05, Ken Victor wrote:
as near as i can tell from the documentation, as long as i don't
implement ignoreModifierKeysWhileDragging (or if i do and it returns
NO), then the dragging cursor should automatically change to the
copy cursor when the user presses the option key. i've returned
NSDragOperationCopy | NSDragOperationDelete | NSDragOperationMove
from my draggingSourceOperationMaskForLocal: method (in my
NSTableView subclass) and i return NSDragOperationGeneric from my
table source
tableView:validateDrop:proposedRow:proposedDropOperation: . but
pressing the option key doesn't change the cursor.
i've discovered that if i return NSDragOperationCopy from
tableView:validateDrop:proposedRow:proposedDropOperation: then the
cursor does change to the copy cursor.
but how do i detect whether or not the option key is pressed in my
tableView:validateDrop:proposedRow:proposedDropOperation: method? or
do i have to do something else to get the automatic behavior?
in searching the archives, all i could find was a suggestion to
override -(NSDragOperation)draggingUpdated:(id
<NSDraggingInfo>)sender in my NSTableView subclass. but i don't see
how to detect the option key press in that method either.
any help/pointers/sample code greatly appreciated.
thanx,
ken
_______________________________________________
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