Skip to content

Instantly share code, notes, and snippets.

@themusicman
Created December 28, 2009 22:05
Show Gist options
  • Save themusicman/264984 to your computer and use it in GitHub Desktop.
Save themusicman/264984 to your computer and use it in GitHub Desktop.
leftSideBounds = [leftSideOfSplitView bounds];
tableScrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, 0, leftSideBounds.size.width, leftSideBounds.size.height)];
[tableScrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[tableScrollView setAutohidesScrollers:YES];
[leftSideOfSplitView addSubview:tableScrollView];
scrollBounds = [tableScrollView bounds];
tableView = [[CPTableView alloc] initWithFrame:CGRectMake(0, 0, scrollBounds.size.width, scrollBounds.size.height)];
[tableView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[tableView setUsesAlternatingRowBackgroundColors:YES];
[tableView setDataSource:self];
var headerColor = [CPColor colorWithPatternImage:[[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:@"button-bezel-center.png"]]];
[[tableView cornerView] setBackgroundColor:headerColor];
var propertyColumn = [[CPTableColumn alloc] initWithIdentifier:@"propertyName"];
[[propertyColumn headerView] setStringValue:"Property Title"];
[[propertyColumn headerView] setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[[propertyColumn headerView] setBackgroundColor:headerColor];
[propertyColumn setWidth:scrollBounds.size.width - 15];
[tableView addTableColumn:propertyColumn];
[tableScrollView setDocumentView:tableView];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment