Re: Font size in NSTableView
Christiaan Hofman <[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
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. Wrong. The /delegate/ is asked what the row height should be, and if the delegate method is not implemented the rowHeight /property/ is used. The cell is /never/ asked about its height for NSTableView layout (only for the expansion tooltip). > > So, if NSTableView does adjust for custom cells, but doesn't for the default text cell, It doesn't adjust for /any/ cell, default or custom. As it should. > a) file a bug about that I see no reason to file a bug report, as I don't see a bug. > and b) set the NSTableView's row height to the height of the size-to-fitted text cell. > But my question is: what is this height? There are many ways to calculate the line height of a font (especially different typesetting behavior), and different Cocoa objects give you different answers by default (NSString, NSCell, NSTextFieldCell, ...). Which one is the relevant calculation? > 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 That does not mean they do it right, given that Apple itself is not even consistent. Moreover, those implementations tell me nothing about my problem, because it just tells me that it behaves the way I describe (use the delegate method or the rowHeight property). It tells me nothing how the rowHeight is /supposed/ to depend on the font, or what font should be used by default. Christiaan