开发者

Drop on NSTableView Behavior

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

I don't need tableView:writeRowsWithIndexes:toPasteboard: because that's for dragging objects out of the NSTableView.

Now, the problem is that I want it to behave kind of iTunes-like. In iTunes 9.x (I don't remember it for the previous versions) you ha开发者_如何学Pythonve an NSTableView (the playlist) and when you drag a file over it you get this blue focus inside the NSTableView (maybe it's the NSScrollView?) and you don't have the blue horizontal line that indicates where you're going to insert an object. So basically I would like:

  • No blue horizontal insert line between rows when hovering a file over the NSTableView.

  • The blue focus inside the NSTableView (or NSScrollView).

Any help would be greatly appreciated so thank you in advance.


From the NSTableView reference:

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

....

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜