Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Drag + Drop Input

Drag + Drop Input
Thread Tools
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status: Offline
Reply With Quote
Jun 30, 2001, 12:50 AM
 
Hello, a few questions:

1. Is there any way to take drag + drop input (specifically the kind where you drop an icon onto the application's icon to launch it with that file) in cocoa without using the document handler (or whatever that is called).

2. Is there any way to allow this behavior with folders? I can get it to accept files by telling the application that it accepts "*" file extensions, however, I can't seem to get it to allow folders to be dropped on it.

I tried to see if it passes the path of the file dropped as an argument but it does not.

Essentially I am trying to make something with "DropStuff"-like behavior.

Can anyone help?

Thanks,
Jeff.
Spectral Class
"Shedding Light on Innovation"
     
Senior User
Join Date: Mar 2000
Location: Ithaca, NY
Status: Offline
Reply With Quote
Jul 1, 2001, 01:25 PM
 
Originally posted by Apocalypse:
<STRONG>Hello, a few questions:

1. Is there any way to take drag + drop input (specifically the kind where you drop an icon onto the application's icon to launch it with that file) in cocoa without using the document handler (or whatever that is called).
</STRONG>
In your application's delegate, implement the application :openFile: method.

<STRONG>
2. Is there any way to allow this behavior with folders? I can get it to accept files by telling the application that it accepts "*" file extensions, however, I can't seem to get it to allow folders to be dropped on it.

</STRONG>
Create a document type in Project Builder with an OS type of 'fold' (without the quotes).
     
Senior User
Join Date: Mar 2000
Location: Ithaca, NY
Status: Offline
Reply With Quote
Jul 1, 2001, 01:30 PM
 
Originally posted by Apocalypse:
<STRONG>Hello, a few questions:

1. Is there any way to take drag + drop input (specifically the kind where you drop an icon onto the application's icon to launch it with that file) in cocoa without using the document handler (or whatever that is called).
</STRONG>
In your application's delegate, implement the application :openFile: method.

<STRONG>
2. Is there any way to allow this behavior with folders? I can get it to accept files by telling the application that it accepts "*" file extensions, however, I can't seem to get it to allow folders to be dropped on it.

</STRONG>
Create a document type in Project Builder with an OS type of 'fold' (without the quotes).
     
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status: Offline
Reply With Quote
Jul 1, 2001, 01:53 PM
 
Perfect!!!

Exactly what I was looking for.

Thanks,
Jeff.
Spectral Class
"Shedding Light on Innovation"
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:42 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2