Re: Drag and drop files
Re: Drag and drop files
- Subject: Re: Drag and drop files
- From: Hsu <email@hidden>
- Date: Sun, 24 Feb 2002 19:41:53 -0800
To register yourself as accepting filenames
[self registerForDraggedTypes:[NSArray
arrayWithObject:NSFilenamesPboardType]];
To grab the filenames
NSArray *dragnames = [NSArray arrayWithArray:[pb
propertyListForType:NSFilenamesPboardType]];
Grab the filenames from (I'm guessing) either draggingUpdated: or
draggingEntered: - if you don't actually want to accept a drop, just
return NSDragOperationNone after grabbing the info you need.
Karl
On Sunday, February 24, 2002, at 06:47 PM, Ben Mackin wrote:
What is it that I would need to do in order to allow the draging of a
file
over a window, and then get the path of the file into a NSString?
I ask because in my program right now I have a choose button that
brings up
an open dialog to choose the file, but it would make things easier for
the
end user if they could just drag the file onto this window.
Thanks,
Ben
http://www.shayufilms.com
_______________________________________________
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.
--
We are sorry, you have reached an imaginary number. Please rotate your
phone ninety degrees and try again.
Homepage:
http://homepage.mac.com/khsu/index.html
_______________________________________________
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.