Re: Drag & Drop Launch
Re: Drag & Drop Launch
- Subject: Re: Drag & Drop Launch
- From: Brian Ganninger <email@hidden>
- Date: Tue, 6 Dec 2005 18:50:02 -0600
Wouldn't
- (void)application:(NSApplication *)sender openFiles:(NSArray *)
filenames;
solve your request? This method is a delegate method for your
NSApplication delegate and it provides a list of filenames dropped
onto your application's icon (Dock or Finder) and you can process as
you will (10.3+). To receive the files you need only register for the
document types, and in the case of folders, you'll register for a
blank UTI/extension/MIME, with an OS type of fold [these settings are
configured in the Get Info window for your application's target in
the list of document types under the Properties tab [Xcode 2.2 used
as reference]
HTH,
brian
On Dec 6, 2005, at 2:56 PM, email@hidden wrote:
Hi All,
After much searching on mailing lists, books, and other sources I
cannot find a straight forward answer to a very basic question.
How do I make my application accept Files or Folders dragged onto
its icon?
I have an already completed Cocoa application (not Document-
based) that takes a file path and performs an operation. Since the
application is so simple there is no File menu. The user hits a
button on the UI and selects the File or Folder and clicks OK. The
application then does its thing and displays the results.
All I want is to give the user the opportunity to by-pass having
to select the file and allow them to drop on the icon. It would
also be nice if the user could drag multiple files and it could
process them one at a time and give the results when all files have
been processed.
Thanks,
Kris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden