NSCollectionView file promise drag & drop and selection
NSCollectionView file promise drag & drop and selection
- Subject: NSCollectionView file promise drag & drop and selection
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 30 Sep 2010 17:25:40 -0600
I searched for answers for these two questions and did not find anything pertinent:
1. I noticed that, on Snow Leopard, when the user clicks on a collection view item, the item is selected, but it doesn't do this on Leopard. Instead, on Leopard, the only way to select an item is to click and drag to select items. I can confirm it's not just my application by using the SourceView sample under Leopard. Normally I would work around this by overriding -mouseDown: and using -frameForItemAtIndex: to figure out what the user clicked on, but that method is only present in Snow Leopard. So has anyone figured out how to get NSCollectionView's selection behavior on Snow Leopard to work on Leopard as well?
2. I'm also wondering if anyone has been successful in doing file promise drags with NSCollectionView in Snow Leopard, and if so, then what did you have to do to get it to work? I'm doing this:
- (BOOL)collectionView:(NSCollectionView *)collectionView writeItemsAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pboard
{
[pboard addTypes:[NSArray arrayWithObject:NSFilesPromisePboardType] owner:self];
[pboard setPropertyList:[NSArray arrayWithObjects:@"rtf", @"rtfd", nil] forType:NSFilesPromisePboardType];
return YES;
}
If I look at the pasteboard in Pasteboard Inspector, I can see the file promise pasteboard types being written to the pasteboard. However, the Finder will not accept the drag. If I do the exact same thing in a table view writeItemsAtIndexes:... method, then it works as expected. If I inspect its pasteboard in Pasteboard Inspector, then it turns out to be identical to the collection view's pasteboard.
Nick Zitzmann
<http://www.chronosnet.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