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 on app icon in Cocoa

Drag & drop on app icon in Cocoa
Thread Tools
Dedicated MacNNer
Join Date: May 2001
Location: Edinburgh, UK
Status: Offline
Reply With Quote
Dec 10, 2001, 05:47 PM
 
How do I enable drag and drop of files on my app icon in Cocoa. I know there is probably some really simple way of doing this but I just can't see it. Any help would be appreciated.
     
Mac Elite
Join Date: Jan 2001
Location: Sad King Billy's Monument on Hyperion
Status: Offline
Reply With Quote
Dec 10, 2001, 07:20 PM
 
You can edit Info.plist inside the application package.
I abused my signature until she cried.
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Dec 10, 2001, 07:31 PM
 
Scrod, what is the point of your signature?

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Dec 10, 2001, 07:35 PM
 
Scrod, is it possible that you could be a little more specific? Your response is sort of like telling a thirsty person to find water in a big bucket: sounds feasable, but where's this bucket and how does one get there?

I searched this forum and the omnigroup's osx-dev forums, and both have very sketchy responses on how to do this. I'd love to find documentation on it, wherever it exists...

Thanks,
F-bacher
     
iJed  (op)
Dedicated MacNNer
Join Date: May 2001
Location: Edinburgh, UK
Status: Offline
Reply With Quote
Dec 10, 2001, 08:19 PM
 
Originally posted by Scrod:
<STRONG>You can edit Info.plist inside the application package.</STRONG>
I also want to know how to get the path of the file(s) that you dropped on it. Sorry if my message was a little unclear.

I have also had problems finding documentation on this - anything on drag & drop seems to be related to things like dropping pictures in windows and the like.
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Dec 10, 2001, 08:45 PM
 
Originally posted by iJed:
<STRONG>

I also want to know how to get the path of the file(s) that you dropped on it. Sorry if my message was a little unclear.

I have also had problems finding documentation on this - anything on drag & drop seems to be related to things like dropping pictures in windows and the like.</STRONG>
That part of the question is pretty simple. The method you use in ur apps delegate is as such:

public boolean applicationOpenFile(NSApplication theApplication, String filename)

Well, the Java version, atleast (the obj-c is the same, just all that crazy obj-c syntax ) As you see, the filename gets passed into the method as a parameter. So there you go.

F-bacher
     
iJed  (op)
Dedicated MacNNer
Join Date: May 2001
Location: Edinburgh, UK
Status: Offline
Reply With Quote
Dec 11, 2001, 04:51 PM
 
Originally posted by Ghoser777:
<STRONG>

That part of the question is pretty simple. The method you use in ur apps delegate is as such:

public boolean applicationOpenFile(NSApplication theApplication, String filename)

Well, the Java version, atleast (the obj-c is the same, just all that crazy obj-c syntax ) As you see, the filename gets passed into the method as a parameter. So there you go.

F-bacher</STRONG>
- (BOOL)application NSApplication *)theApplication openFile NSString *)filename

I did this (in ObjC) and it works excellently! Thank you for your help on this. :-)
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Dec 11, 2001, 06:22 PM
 
Originally posted by iJed:
<STRONG>

- (BOOL)application NSApplication *)theApplication openFile NSString *)filename

I did this (in ObjC) and it works excellently! Thank you for your help on this. :-)</STRONG>
Well, now I understand what the "Disable smilies" option is for...

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
   
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 03:02 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