NSTableView

From GNUstepWiki

(Difference between revisions)
Revision as of 21:31, 16 February 2005
Stefan Urbanek (Talk | contribs)

← Previous diff
Revision as of 01:59, 9 July 2005
Quineska (Talk | contribs)

Next diff →
Line 1: Line 1:
-Table ...+NSTableView is located within the AppKit (gnustep-gui library) and is used to create display tables. It uses a delegate model for getting it's data i.e. you give it an object that provides it with the data it should display.
== Code chunks == == Code chunks ==

Revision as of 01:59, 9 July 2005

NSTableView is located within the AppKit (gnustep-gui library) and is used to create display tables. It uses a delegate model for getting it's data i.e. you give it an object that provides it with the data it should display.

Code chunks

Autosize row height according to font

Following code autosizes the row height according to the size of data cell font:

- (void)autosizeRowHeight
{
   NSTableColumn *col = [[self tableColumns] objectAtIndex:0];
   NSFont        *font;

   font = [[col dataCell] font];

   [self setRowHeight:[font maximumAdvancement].height];
}

Use the method in a category of NSTableView.