Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView font



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.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.