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
1
vote
4 answers

How to disable drag-n-drop for NSTextField?

I want to disallow dropping anything into my NSTextField. In my app, users can drag and drop iCal events into a different part of the GUI. Now I've had a test user who accidentally dropped the iCal event into the text field – but he didn't realize…
Yang Meyer
  • 5,409
  • 5
  • 39
  • 51
1
vote
1 answer

Cocoa WebView Drag-Drop

In my Application i have one NSOutlineView having list of somefiles and one WebView, User allows to drag any item from the Outline view to WebView, and on that , i am suppose to handle the database transaction, In the Outline view , i have…
Amitg2k12
  • 3,765
  • 10
  • 48
  • 97
1
vote
1 answer

NSDragOperation for drag vom NSTableView is -1

Simple setup: I've got an NSTableView that allows items to be dragged to an NSView subclass. In the view I'm checking the drag operation via NSDraggingInfo's method draggingSourceOperationMask. Drops received there have a NSDragOperation of -1.…
ATV
  • 4,116
  • 3
  • 23
  • 42
1
vote
2 answers

draggingEntered not called

I have an NSBox subclass called dragBox. I want to be able to drag it around a canvas. The code is as follows: -(void) awakeFromNib { [[self superview] registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]]; } -(void)…
bc888
  • 141
  • 14
0
votes
1 answer

Reorder and Move NSTableView Row with NSPasteboard

I have an NSTableView where I can drag and drop table rows to reorder them. This works by setting a drag type in my view controller: @IBOutlet weak var tableView: NSTableView! let dragType = NSPasteboard.PasteboardType(rawValue:…
Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128
0
votes
0 answers

How to change the number presented when dragging items

In NSCollectionView when you are dragging multiple items, there is a red circle with a number that indicates the number of dragged items. I need to manipulate this number or at least hide it. Can anyone give me a clue how to do this? Here is an…
Sanich
  • 1,739
  • 6
  • 25
  • 43
0
votes
1 answer

How do I implement drag-and-drop from Photos to my Cocoa app with full quality?

In my drag destination view (NSView subclass), I have implemented: override func performDragOperation(_ draggingInfo: NSDraggingInfo) -> Bool { // check for Photos promises var gotPromised = false …
Jaanus
  • 17,688
  • 15
  • 65
  • 110
0
votes
1 answer

NSPasteboard Copy Dragged and Dropped File

Although I have working code, I'm confused about whether I'm taking the right approach to NSPasteboard and I am reaching out to see if anyone can help me clarify the best approach. There doesn't appear to be any full documentation written by Apple…
sketchyTech
  • 5,746
  • 1
  • 33
  • 56
0
votes
1 answer

The Window loses focus after Drag & Drop

I am working on a xcode mac app using swift. I implemented Drag & Drop files to NSTableView and it works fine except after the drag and drop operation from the file system the window loses focus. override func performDragOperation(sender:…
Anand
  • 35
  • 1
  • 8
0
votes
2 answers

draggingEntered not firing

I have a subclass of NBox that I would like to drag around a canvas called dragBox. I don't understand why draggingEntered isn't being fired on the following code. I get a nice slideback image, but none of the destination delegates are getting…
bc888
  • 141
  • 14
0
votes
2 answers

Drag Drop delegate for NSView could not set an attribute

I am using NSView delegate to read the dragged excel values. For this I have subclassed NSView. My code is like- @interface SSDragDropView : NSView { NSString *textToDisplay; } @property(nonatomic,retain) NSString *textToDisplay;…
triandicAnt
  • 1,328
  • 2
  • 15
  • 40
0
votes
1 answer

How to run a method from appdelegate after a controller has finished running?

The idea is that I hava a custom view where the user can drag and drop one or more files and the controller is able to save the path of files into an array. How can I run a method from AppDelegate after the user drops the file in the interface? I…
user1792771
  • 99
  • 13
0
votes
1 answer

How to Drag row from NSOutlineView to NSTableview

I am learning drag and drop in cocoa... I am unable to drag row from NSOutlineView to drop in NSTableView its to difficult for me.. I have tried the following methods.. - (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray…
NewStack
  • 990
  • 8
  • 19
0
votes
1 answer

How to see how many files in draggingPasteboard?

I have a drag operation that only allows to drag a single file, and I want to capture this on "draggingEntered" like so: - (NSDragOperation)draggingEntered:(id)sender { if ([[sender draggingPasteboard] count]] == 1) { return…
PropellerHead
  • 929
  • 1
  • 12
  • 27
1
2