• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableView, file promises, and the message queue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView, file promises, and the message queue


  • Subject: Re: NSTableView, file promises, and the message queue
  • From: David Remahl <email@hidden>
  • Date: Tue, 13 May 2003 16:31:56 +0200

I have the same problem too...I've tried many methods of working around it, but all lead to quirks such as stalls or odd table view selection behaviour...

Has anyone on the list successfully implemented promise drags for a TableView / OutlineView? I think it is an oversight on Apple's part not to provide a method for manually adding the promise drag sources to the dragging pasteboard, since that would have allowed us to use the default method for starting drags from table views.

/ Rgds, David

On Tuesday, May 13, 2003, at 03:08 PM, Nick Zitzmann wrote:

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.
_______________________________________________
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: 
 >NSTableView, file promises, and the message queue (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: NSAttributedString encoding
  • Next by Date: iTangram
  • Previous by thread: NSTableView, file promises, and the message queue
  • Next by thread: Re: NSTableView, file promises, and the message queue
  • Index(es):
    • Date
    • Thread