Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dragging



well, you can, but even that isn't necessary. There is no reason to use the pasteboard at all.


On Jan 31, 2004, at 3:59 AM, Daryn wrote:


On Jan 31, 2004, at 2:30 AM, Scott Anguish wrote:

On Jan 30, 2004, at 2:51 PM, mmalcolm crawford wrote:

Archiving the object covers the general case where the destination may be in a different application...



True, but that may not be applicable.

if you're doing strictly local dragging, there is no reason you can't set an instance variable somewhere to the object (objects) being dragged when the drag begins, and then get the object reference from that instance variable when the drag completes. This is often applicable when dealing with, oh, say an NSTableView.. :-)

For intra-table view dragging only, you can just stick the row indices onto the pasteboard like this:

- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard {
[pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
[pboard setPropertyList:rows forType:NSStringPboardType];
return YES;
}

Extract in the acceptDrop with [[info draggingPasteboard] propertyListForType:NSStringPboardType].
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Dragging (From: Herr Witten <email@hidden>)
 >Re: Dragging (From: Herr Witten <email@hidden>)
 >Re: Dragging (From: mmalcolm crawford <email@hidden>)
 >Re: Dragging (From: Scott Anguish <email@hidden>)
 >Re: Dragging (From: Daryn <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.