Skip to content

Instantly share code, notes, and snippets.

@hammerdr
Created October 4, 2009 20:09
Show Gist options
  • Save hammerdr/201610 to your computer and use it in GitHub Desktop.
Save hammerdr/201610 to your computer and use it in GitHub Desktop.
@import <AppKit/CPView.j>
@implementation OLResourceView : CPView
{
}
- (id)initWithFrame:(CGRect)frame
{
if(self = [super initWithFrame:frame])
{
var filterView = [[CPScrollView alloc] initWithFrame:CGRectMake(20,20,CGRectGetWidth(frame)/4-40, 200)];
var filterTableView = [[CPTableView alloc] initWithFrame:CGRectMake(0,0,CGRectGetWidth([filterView bounds]), 200)];
var filterTableColumn = [[CPTableColumn alloc] initWithIdentifier:@"filterColumn"];
[filterTableColumn setWidth: CGRectGetWidth([filterTableView bounds])];
[filterTableView addTableColumn: filterTableColumn];
[filterTableView setUsesAlternatingRowBackgroundColors:YES];
[filterView setDocumentView:filterTableView];
[filterTableView setDataSource:self];
[self addSubview:filterView];
}
return self;
}
- (int)numberOfRowsInTableView:(CPTableView)view
{
return 50;
}
- (id)tableView:(CPTableView)view objectValueForTableColumn:(CPTableColumn)column row:(int)row
{
return "Bob";
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment