• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drag and drop files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • <no subject>
      • From: Ben Mackin <email@hidden>
    • Garbled File
      • From: Ben Mackin <email@hidden>
References: 
 >Drag and drop files (From: Ben Mackin <email@hidden>)

  • Prev by Date: Re: Frameworks inside applications
  • Next by Date: NSCalendarView / NSCalendarControl
  • Previous by thread: Drag and drop files
  • Next by thread: Garbled File
  • Index(es):
    • Date
    • Thread