Mouseover in NSTableView

前端 未结 1 1737
不思量自难忘°
不思量自难忘° 2021-01-23 16:13

I\'m having trouble creating a mouseover function with an NSTableView. The idea is that (if the feature is selected in prefs) placing the mouse pointer above a particular row in

相关标签:
1条回答
  • 2021-01-23 16:53

    You're on the right track with -mouseEntered: and -mouseExited:.

    Look into NSView's -addTrackingRect:owner:userData:assumeInside: and -removeTrackingRect: methods. You can either set up your tableView to create trackingRects for every row that's in there whenever the contents of the tableView change, or alternatively, set up/update one tracking area on the entire tableView whenever -tile or another layout related method is called.

    0 讨论(0)
提交回复
热议问题