browser(_:sizeToFitWidthOfColumn:)
Returns the ideal width for a column.
Declaration
@MainActor optional func browser(_ browser: NSBrowser, sizeToFitWidthOfColumn columnIndex: Int) -> CGFloatParameters
- browser:
The browser.
- columnIndex:
The index of the column to size. If
-1, the result is used to resize all columns.
Return Value
The ideal width of the column. This method is used when performing a “right-size” operation, that is, when sizing a column to the smallest width that contains all the content without clipping or truncating.
Discussion
If columnIndex is –1, you should return a size that can be uniformly applied to all columns (that is, every column will be set to this size).
Returning a value of -1 allows you to opt-out of providing a width for the requested column.
Discussion
This method applies only to browsers with resize type NSBrowser.ColumnResizingType.userColumnResizing.
It is assumed that the implementation may be expensive, so it will be called only when necessary.