• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Adjusting NSTableView row height for custom fonts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adjusting NSTableView row height for custom fonts


  • Subject: Adjusting NSTableView row height for custom fonts
  • From: Matt Judy <email@hidden>
  • Date: Wed, 09 Jan 2002 21:46:37 -0800

Hello,

I'm allowing the user to select the font for browsing a list in an NSTableView. I'm setting the font in the tableView's dataSource:

- (void)tableView:(NSTableView *)aTableView
willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
if ([aCell respondsToSelector:@selector(setFont:)]) {
NSFont *font = [preferences browseTableFont];
[aCell setFont:font];
}

...
}

When I do this, I have 2 problems.

1-) Even if I use the default font (Lucida Grande 13pt), it is drawn in the cell below middle. NSCell doesn't seem to have a method for setting vertical alignment.

2-) The cell height is too small to display large fonts. I can use setRowHeight: to adjust the height of the cells, but the centering thing is still a problem.

I'm assuming there's a nice implementation already in use out there... How have you guys been doing this?

Thanks.
--Matt Judy


  • Prev by Date: Re: Database
  • Next by Date: Need help setting font of NSTextView
  • Previous by thread: Small Font Troubles Resolved
  • Next by thread: Need help setting font of NSTextView
  • Index(es):
    • Date
    • Thread