js-osx-app-examples icon indicating copy to clipboard operation
js-osx-app-examples copied to clipboard

NSMatrix selected item

Open Slavetz opened this issue 7 years ago • 2 comments

your examples very awesome how can i get NSMatrix selected item... Item.tag or item.index for example

Slavetz avatar Jan 18 '17 17:01 Slavetz

Hey @Slavetz. I'm looking at the NSMatrix docs https://developer.apple.com/reference/appkit/nsmatrix?language=objc but I'm not sure how to get the selected item. Would have to dig in further. It's been a while since I worked with these examples.

tylergaw avatar Jan 30 '17 00:01 tylergaw

its work as:

console.log(matrix1.selectedCell.title.js);
console.log(matrix1.selectedCell.tag);

And one moment... if you need select other cell as default (not first) you need to use selectCell method, selection of different state for cells is not enough

matrix1.selectCellAtRowColumn(row, column)
matrix1.selectCellWithTag(tag)

tag, row, column must has int value

Slavetz avatar Jan 31 '17 12:01 Slavetz