Post

Replies

Boosts

Views

Activity

AppKit.NSOutlineView: How to get width of indentation marker(disclosure triangle) area
I'm using NSOutlineView that is view based and is single column. To calculate each row view height in delegate method, I need to know row view width in column, before drawn. I think I need to subtract indent width from column width to know row view width. But I couldn't find how to get width of indentation marker(disclosure triangle) area. Is there any solution? // MARK: NSOutlineViewDelegate func outlineView(_ outlineView: NSOutlineView, heightOfRowByItem item: Any) - CGFloat { let columnWidth = outlineView.tableColumns.first!.width let indentationMarkerWidth = CGFloat(17)//- I want get it dynamically!! let indentWidth = outlineView.indentationPerLevel * CGFloat(outlineView.level(forItem: item)) let viewWidth = columnWidth - (indentWidth + indentationMarkerWidth) return calcRowHeightFor(item: item, inViewWidth: viewWidth)//my custom function }
2
0
668
Mar ’21