Created
January 11, 2011 00:01
-
-
Save ConnorD/773743 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation AppController : CPObject | |
{ | |
CPScrollView scrollView; | |
CPTableView tableView; | |
CPArray data; | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ | |
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask], | |
contentView = [theWindow contentView]; | |
scrollView = [[CPScrollView alloc] initWithFrame:[contentView bounds]]; | |
tableView = [[CPTableView alloc] init]; | |
//[tableView setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin]; | |
data = [[CPArray alloc] init]; | |
[data addObject:@"test"]; | |
[data addObject:@"another 1"]; | |
var theColumn = [[CPTableColumn alloc] initWithIdentifier:@"theColumn"]; | |
[[theColumn headerView] setStringValue:@"The Column"]; | |
[theColumn setTableView:tableView]; | |
[tableView addTableColumn:theColumn]; | |
[scrollView setDocumentView:tableView]; | |
[tableView setDataSource:self]; | |
[tableView setDelegate:self]; | |
[contentView addSubview:tableView]; | |
[theWindow orderFront:self]; | |
// Uncomment the following line to turn on the standard menu bar. | |
//[CPMenu setMenuBarVisible:YES]; | |
} | |
- (int)numberOfRowsInTableView:(CPTableView)aTableView { | |
return [data count]; | |
} | |
- (id)tableView:(CPTableView)aTableView objectValueForTableColumn:(CPTableColumn)aTableColumn row:(int)rowIndex { | |
return [data objectAtIndex:rowIndex]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment