Sunday, November 19, 2017

NSTableView inside the NSCollectionViewItem, how to make context menu work?

Leave a Comment

I have NSTableView nested inside NSCollectionViewItem of NSCollectionView. I've tried to implement the context menu for the table, but it seems not to work properly in this situation.

The problem is that while the menu is shown on Control click, clickedRow value is always -1, and in line with that the row is never highlighted.

I've tried to subclass the NSTableView and override menuForEvent and it allows me to capture the real value of the clicked row, but I still have no visual feedback. I may implement some custom view for that, but I hope there is some better way to do that (somehow to programmatically patch this problem and make NSTableView aware that the row is clicked). Someone knows how to do it?

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment