Questions tagged [nsdragginginfo]

The NSDraggingInfo protocol declares methods that supply information about a dragging session.

The NSDraggingInfo protocol declares methods that supply information about a dragging session.

NSDraggingInfo protocol methods are designed to be invoked from within a class’s implementation of NSDraggingDestination protocol methods. The Application Kit automatically passes an object that conforms to the NSDraggingInfo protocol as the argument to each of the methods defined by NSDraggingDestination. NSDraggingInfo messages should be sent to this object; you never need to create a class that implements the NSDraggingInfo protocol.

Home Page: https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/Protocols/NSDraggingInfo_Protocol/Reference/Reference.html

29 questions
22
votes
2 answers

Defining and using protocols in objective-c

I'm trying to extend NSImageView so I can delegate the drag/drop responsibility to the controller. It all works fine with the one problem that the compiler is now displaying warnings about sending messages to objects with type id. To solve this I…
Tricky
  • 7,025
  • 5
  • 33
  • 43
10
votes
2 answers

How to use a NSStatusItem as a drag destination?

I'm trying to build an application that allows users to drag files from Finder to the menubar icon for processing. I've made progress in my journey, but I can't seem to summit this hill. I tried subclassing NSView and implementing the drag…
doomspork
  • 2,302
  • 1
  • 17
  • 24
6
votes
1 answer

Drag and Drop — Only Folders Accepted

I'm writing a custom view that needs to accept folder drops. The condition is: only directories are accepted, so when user drags a file nothing should happen. I've registered my view with: [self registerForDraggedTypes:[NSArray…
sidyll
  • 57,726
  • 14
  • 108
  • 151
5
votes
1 answer

How do I Drag and Drop a '.txt' file in obj-c

I'm trying to write some absolutely barebones code where I can drag a plain 'dot.txt' file onto an NSWindow and read in the data (and nothing fancier than that), but all the examples I've been able to find use images and NSViews etc.. Apple's…
Bender
  • 357
  • 5
  • 15
5
votes
1 answer

Drag and drop in an NSView

I'm testing drag and drop in an NSView, but draggingEntered: is never called. Code: #import @interface testViewDrag : NSView @end @implementation testViewDrag - (id)initWithFrame:(NSRect)frame { self =…
Red Mak
  • 1,176
  • 2
  • 25
  • 56
4
votes
2 answers

How can I allow moving and copying by dragging rows in an NSTableView?

I have an NSTableView which I wish to be able to drag and drop rows to move them, and drag and drop while holding Option (as per Apple's documentation) to copy them. I have the following code in my view controller, which is also the dataSource of…
DanielGibbs
  • 9,910
  • 11
  • 76
  • 121
4
votes
2 answers

Reading Multiple Dragged-n-Dropped Files

I have a small window inside the main xib (MainMenu.xib) with an NSImageView control for an OS X application. This view control has an NSImageView subclass that is supposed to accept files that the user brings (drag n drop). Since I have no…
El Tomato
  • 6,479
  • 6
  • 46
  • 75
4
votes
2 answers

NSOutlineView drag image

I want to change the image used when I drag an item from a view- and datasource-based NSOutlineView, but can't seem to find a hook. I've tried modifying - (void)dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset…
3
votes
1 answer

How do I detect if a drag operation was cancelled using NSDraggingInfo or similar?

I've created a subclass of NSImageView and implemented the informal protocol for dragging images between other instances of the same class. I am keeping a reference to the image of the view prior to the dragging operation and am able to set it back…
3
votes
0 answers

Issues coupling NSDraggingSource w/NSMatrix

Picture this sparsely populated NSMatrix, five coloured columns (0-4), with the most recently added column in orange. These are populated with stand-in objects (random numbers) with the (x,y) coordinates noted. "Blank" cells have stand-in NULL…
zzyzy
  • 973
  • 6
  • 21
3
votes
1 answer

Drag & drop () in Cocoa does not work

I want to implement some "simple" drag & drop into my Mac application. I dragged in a view and entered "MyView" in my nib file accordingly.However I do not get any response in my console (I try to log messages whenever any of the protocol methods…
the_critic
  • 12,720
  • 19
  • 67
  • 115
2
votes
1 answer

NSTableView Drop App File, Whats Going Wrong?

I have the following code to support dropping an app file into a table view. The problem is that I don't even see the green + when I drag and drop. I think it has something to do with the registerForDraggedTypes: but I'm not sure. I've tried many…
nosedive25
  • 2,477
  • 5
  • 30
  • 45
2
votes
1 answer

Drag and drop doesn't work with subclass of NSBox

I've created a subclass of NSBox to implement drag and drop. I have the following code: @interface DropView : NSBox { } - (NSDragOperation)draggingEntered:(id )sender; - (BOOL)performDragOperation:(id…
indragie
  • 18,002
  • 16
  • 95
  • 164
1
vote
1 answer

Can NSTableView handle normal drag-and-drop methods?

I'd like to use NSTableView without the NSTableViewDataSource Methods but just like a normal view. draggingEntered: and draggingExited: are being called but when I return NSDragOperationCopy, I don't see the green plus mouse pointer and…
1
vote
1 answer

Drag and drop not working for NSTableView

I have implemented drag and drop feature in my application. All the functionality are well but when we drag a image in to NSTableView, - (BOOL)performDragOperation:(id < NSDraggingInfo >)sender method is not getting called. Can any one tell me the…
akhil
  • 11
  • 4
1
2