NSTableView, file promises, and the message queue
NSTableView, file promises, and the message queue
- Subject: NSTableView, file promises, and the message queue
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 13 May 2003 06:08:16 -0700
OK, I've searched the archives and found this,
<
http://cocoa.mamasam.com/COCOADEV/2003/03/1/57866.php>, which
describes my problem exactly, but no one answered.
I've set up an NSTableView to do drag-and-drop, and it's done by using
file promises. Since there isn't any way currently to create a file
promise pasteboard, I'm using the workaround I read about, which is to
manually call -dragPromisedFilesOfType: within the data source's
-tableView:writeRows:toPasteboard: method.
Things work fine, but now I'm having yet another weird problem:
Drag-and-drop works, but after the drop, the application just "sticks".
That is, the message queue just stops until the user clicks somewhere
in the application, and then it magically restarts.
Is there any workaround or fix for this? I'm using something similar
(but not the same) as this:
- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray *)rows
toPasteboard:(NSPasteboard *)pboard
{
NSPoint dragPosition = [tableView convertPoint:[window
convertScreenToBase:[NSEvent mouseLocation]] fromView:nil];
NSRect imageLocation;
long i;
// This code sets up the "image" so that it appears directly in the
center of the cursor.
dragPosition.x -= 16;
dragPosition.y -= 16;
imageLocation.origin = dragPosition;
imageLocation.size = NSMakeSize(32,32);
[tableView dragPromisedFilesOfTypes:[NSArray arrayWithObject:@""]
fromRect:imageLocation source:tableView slideBack:YES event:[NSApp
currentEvent]];
return NO;
}
Any ideas would be appreciated...
Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page:
http://dreamless.home.attbi.com/
"Great spirits have always encountered violent opposition from mediocre
minds." - Albert Einstein
_______________________________________________
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.