显然,如果您setDoubleAction()
NSTableView
,可以使用clickedRow
来获取双击的行,但是有没有办法获得双倍的实际位置 - 点击?我正在处理的应用程序在单元格中有几个东西,我想双击不同的区域来做不同的事情。
答案 0 :(得分:1)
使用当前事件:
NSEvent* currentEvent = [NSApp currentEvent];
NSPoint eventLocation = currentEvent.locationInWindow;
NSPoint viewClickLoc = [self.view convertPoint:eventLocation fromView:nil];