1
votes

I've implemented - (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row in my NSTableView's delegate to resize the height of my table's rows as the width of the leftmost column changes. The problem is that only that column redraws during the resizing (and any column that slide into view during the resize).

This results in the funky visual below after resizing. What I'd like is a way to tell the table view to completely redraw while the user is resizing a column. Right now the most I've been able to do is call setNeedsDisplay after that column finishes resizing.

alt text

2

2 Answers

2
votes

Check out the NSTableView method noteHeightOfRowsWithIndexesChanged:. You'll need to make an NSIndexSet of the rows whose heights have changed.

update: In order to have a safe place to call this, you can subclass NSTableColumn to override the setWidth: method. You can then post a custom notification that your table delegate can observe, or you can override the table view also and have the column tell the table to tell its delegate directly.

1
votes

It may not be the only way, but giving the table view a Core Animation layer fixed it. It's not 100% smooth, but the average user would probably never notice.