Decrease NSTableView behavior

I have an NSTableView, and I have successfully implemented both tableView:validateDrop:proposedRow:proposedDropOperation: and tableView:acceptDrop:row:dropOperation:

I do not need tableView:writeRowsWithIndexes:toPasteboard: because to drag and drop objects from NSTableView.

Now the problem is that I want it to behave like iTunes. In iTunes 9.x (I don’t remember it for previous versions) you have an NSTableView (playlist), and when you drag the file on top of it, you get this blue focus inside the NSTableView (maybe it is NSScrollView?), And you don’t have a blue horizontal line indicating where you are going to embed the object. So basically I would like to:

  • There is no blue horizontal line to insert between lines when a file hangs over an NSTableView.

  • Blue focus inside NSTableView (or NSScrollView).

Any help would be greatly appreciated, therefore in advance.

+5
source share
1 answer

From the NSTableView link :

 - (void)setDropRow:(NSInteger)row dropOperation:(NSTableViewDropOperation)operation 

....

"Passing a value of –1 for a row and NSTableViewDropOn as an operation causes the entire table view to be selected, not a specific row. This is useful if the data displayed by the recipient does not allow the user to drop items at a specific row location

+7
source

Source: https://habr.com/ru/post/1300498/


All Articles