Difference between revisions of "NSTableView"
Jump to navigation
Jump to search
m (typo) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | NSTableView is located within the AppKit (gnustep-gui library) and is used to display tables. It uses a delegate model for getting its data i.e. you give it an object that provides it with the data it should display. | |
== Code chunks == | == Code chunks == | ||
Line 18: | Line 18: | ||
Use the method in a category of NSTableView. | Use the method in a category of NSTableView. | ||
+ | |||
+ | |||
+ | [[Category:AppKit]] | ||
+ | [[Category:Snippets]] |
Latest revision as of 20:51, 28 February 2007
NSTableView is located within the AppKit (gnustep-gui library) and is used to display tables. It uses a delegate model for getting its 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.