Re: mouse pointer for drag copy
Re: mouse pointer for drag copy
- Subject: Re: mouse pointer for drag copy
- From: Adam Maxwell <email@hidden>
- Date: Thu, 29 Jul 2004 14:14:55 -0500
On Jul 29, 2004, at 13:46, Nick Zitzmann wrote:
On Jul 29, 2004, at 11:11 AM, Adam Maxwell wrote:
[tv dragPromisedFilesOfTypes:[NSArray arrayWithObject:@""]
fromRect:imageLocation
source:tv
slideBack:YES
event:[NSApp currentEvent]];
In addition to what Allan said, calling -dragPromisedFilesOfTypes:...
inside -tableView:writeRows:toPasteborad: is a bad idea and will cause
some glitches in your program, like the message queue mysteriously
freezing after the call.
I had some major hanging problems when I was sending an array with
multiple file types in dragPromisedFilesOfTypes:, but those went away
when I switched to the above code. Is that similar to what you refer
to?
If you want to do a file-promise drag to the Finder (or Path Finder,
etc.) from an NSTableView, the only way to do this glitch-free is to
subclass NSTableView, override -mouseDown: to handle highlighting and
click-actions (which you'll have to write yourself, but it isn't as
difficult as it sounds), and override -mouseDragged: to call
-dragPromisedFilesOfTypes:... or implement periodic event handling,
which is more difficult to do.
Thanks, I actually tried that initially, but the example in the
drag-and-drop documentation broke my tableview for most purposes, and
re-implementing the tableview selection behavior was more than I wanted
to tackle at that time (or this time, for that matter).
--
Adam Maxwell
_______________________________________________
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.