As documented on developer.apple.com, when many drag types are
registered within a call to tableView:writeRows:toPasteboard:, you may
send zero or one data chunk to the pasteboard and the needed data will
be requested later by a call to pasteboard:provideDataForType: by the
NSPasteBoard to the "owner" (i.e. the tableview delegate).
Now, with GNUstep, pasteboard:provideDataForType: is never called while
it's possible to register all of the chunks within
tableView:writeRows:toPasteboard:. On OSX, only the first chunk
registered within that method is taken into account.
While I consider the OS X way to not be 100% right, it still works as
documented when on GNUstep it doesn't.
Example code, from Cynthiune:
- (BOOL) tableView: (NSTableView *) tv
writeRows: (NSArray *) rows
toPasteboard: (NSPasteboard*) pboard
{
NSArray *types;
BOOL accept;
unsigned int count;
count = [rows count];
if (count > 0)
{
accept = YES;
types = [NSArray arrayWithObjects: CynthiunePlaylistDragType,
NSFilenamesPboardType, nil];
[pboard declareTypes: types owner: self];
[pboard setPropertyList: rows forType: CynthiunePlaylistDragType];
}
else
accept = NO;
return accept;
}
- (void) pasteboard: (NSPasteboard *) sender
provideDataForType: (NSString *) type
{
NSLog (@"provide Data...");
}
I have then taken a look at gui 0.9.4's gui code for NSTableView and I
could not understand everything.
A work-around for this problem would be to call pasteboard:provideDataForType:
directly after writeRows... is called, but then it's not clean.
So, my question is:
- is there any current effort to fix this?
- if not and if I have time to fix it by myself, where should I look at?