NSTableView custom class
NSTableView custom class
- Subject: NSTableView custom class
- From: Oscar Bascara <email@hidden>
- Date: Sun, 22 Jul 2001 00:43:43 -0700
I'm trying to subclass NSTableView but the scroll bars never show up
with the rows eventually going off the window frame. Also the rows grow
from bottom to top instead of top to bottom. What's incorrect with my
initWithFrame: method for the subclass? I'm pretty sure I'm missing
stuff. For example, how do I even access the underlying NSScrollView to
set vertical scroll bars?
- (id)initWithFrame:(NSRect)frameRect
{
if (self = [super initWithFrame:frameRect]) {
[self setAllowsEmptySelection:NO];
[self setAllowsMultipleSelection:NO];
[self setAllowsColumnSelection:NO];
[self setDrawsGrid:YES];
[self setRowHeight:15.0];
tableColumn = [[NSTableColumn alloc]
initWithIdentifier:@"name"];
[self addTableColumn:tableColumn];
[self sizeLastColumnToFit];
}
return self;
}
Oscar