• 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
Drag folder from Finder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag folder from Finder


  • Subject: Drag folder from Finder
  • From: Onar Vikingstad <email@hidden>
  • Date: Thu, 4 Apr 2002 18:40:22 +0200

Hi.

I've been trying to create a feature in my app, where I can drag a folder from the Finder over to a TextField and then have it updated with the path to the folder dropped on it.

This is what I've been doing, but the field directoryField does not respond when I try to drag something on it, so I don't think draggingEntered is executed at all. Is NSFilenamesPboardType the right PboardType to use for this? (sorry, I'm pretty new to this stuff!)

- (void)awakeFromNib {
[directoryField registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,nil,nil]];
}

- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender {
NSString *aFile = NSFilenamesPboardType;
[directoryField setStringValue:aFile];
}
_______________________________________________
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.

  • Prev by Date: Re: Resource Management ??
  • Next by Date: Re: NSFileManager trouble?
  • Previous by thread: Re: NSScroller not changing value when i click up/down arrows
  • Next by thread: Re: setting the datacell of table to combobox
  • Index(es):
    • Date
    • Thread