NSTableView font
NSTableView font
- Subject: NSTableView font
- From: Steven Spencer <email@hidden>
- Date: Wed, 24 Mar 2004 09:50:10 +0000
Hello,
I'm trying to set the font of a tableview at runtime. This is described in a previous post on this list :
http://lists.apple.com/archives/cocoa-dev/2004/Feb/09/nstableviewfontsize.txt
According to the post, after setting the dataCell font of each column, invoking the tile method of the tableview will automatically adjust the table row heights. This doesn't work for me - the row heights don't change but the font does, so I hope someone can find something wrong with my code :
- (void)updateUI
{
NSFont *fnt = [NSFont systemFontOfSize:36.0];
NSEnumerator *enm = [[myTableView tableColumns] objectEnumerator];
NSTableColumn *col;
while (col = [enm nextObject])
[[col dataCell] setFont:fnt];
[myTableView tile];
}
I have to use the following code instead of tile :
[myTableView setRowHeight:
[[[[myTableView tableColumns] objectAtIndex:0] dataCell] cellSize].height];
The Cocoa documentation says that setRowHeight invokes tile.
I'm using XCode on OS 10.3.2.
Thanks.
- Steve Spencer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.