NSTableView - Trying to fit exactly 9 rows

Posted by Justin808 on Stack Overflow See other posts from Stack Overflow or by Justin808
Published on 2011-03-02T07:05:07Z Indexed on 2011/03/02 7:24 UTC
Read the original article Hit count: 256

Filed under:
|

Hi, I'm trying to size the rows of a NSTableView to exactly 9 rows fit. I've tried [menuTableView setRowHeight:floor(menuRect.size.height / 9)]; and I've tried [menuTableView setRowHeight:(menuRect.size.height / 9)]; and [menuTableView setRowHeight:ceil(menuRect.size.height / 9)]; but all of them have the same issue, if I've selected row 0 then row 9 is clipped at the bottom and if I select row 9 then row 0 is clipped at the top.

How can I set up a NSTableView to show 9 full rows so no matter what there is never a partial row visible?

Thanks,

edit: Yes menuRect is the frame for the menuTableView

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about nstableview