Re: Font size in NSTableView

Christiaan Hofman <[email protected]>
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
I think this whole discussion got sidetracked towards irrelevant things. I still have no answer to my questions:

1. What is the preferred font that should be used in (regular sized) table views?
2. How do I calculate the preferred table view row height given a font used in its (text) cells?

As for 1, to make things more confusing, note that NSFont has a -controlContentFontOfSize: that defaults to 12pt LucidaGrande (when passing 0) and that seems to be related to table content. Is this the same (symbolic) font that the HIG calls the "view font?" Ans it does not correspond to what IB defaults to.

As for 2, I cannot find any calculation method that is consistent across IB, NSTextFieldCell, NSCell, and Apple apps (like Mail). So I don't know which one to take as the preferred way.

thanks,
Christiaan


On Feb 17, 2010, at 21:23, Markus Hitter wrote:

> 
> Am 17.02.2010 um 20:53 schrieb Christiaan Hofman:
> 
>> On Feb 17, 2010, at 20:07, Markus Hitter wrote:
>>> 
>>> Am 17.02.2010 um 18:33 schrieb Christiaan Hofman:
>>> 
>>>>> Well, change the font and NSTableView should adopt.
>>>> 
>>>> NSTableView does not have a font.
>>> 
>>> The cell's font, of course.
>> Yes, and because of that the tableview's settings won't be affected, because no property of the tableview is changed. This is also exactly what happens (i.e. nothing).
> 
> Right. I already tried to explain NSTableView doesn't neccessarily have a "row height" property. Individual rows can have different heights and if you happen to replace the default cell with a custom cell, this cell is asked about what the row height should be. If there actually is such a property, it's a fallback at best.
> 
> So, if NSTableView does adjust for custom cells, but doesn't for the default text cell, a) file a bug about that and b) set the NSTableView's row height to the height of the size-to-fitted text cell.
> 
> For more illustration on how table views work, you can look up Cocotron and/or GNUstep source code. Both have a Cocoa compatible NSTableView implementation.
> 
> 
> Markus
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.