/Tests/Manual/CPUserDefaults/AppController.j

http://github.com/cacaodev/cappuccino · Unknown · 49 lines · 34 code · 15 blank · 0 comment · 0 complexity · cd5fafdfec35dc23c84f69f3037d18f3 MD5 · raw file

  1. @import <AppKit/CPTableView.j>
  2. @implementation AppController : CPObject
  3. {
  4. }
  5. - (void)applicationDidFinishLaunching:(CPNotification)aNotification
  6. {
  7. var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(50.0, 100.0, 400.0, 300.0) styleMask:CPTitledWindowMask],
  8. contentView = [theWindow contentView];
  9. var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0.0, 0.0, 400.0, 300.0)],
  10. tableView = [[CPTableView alloc] initWithFrame:CGRectMake(0.0, 0.0, 400.0, 300.0)];
  11. [scrollView setDocumentView:tableView];
  12. [scrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
  13. var tableColumn1 = [[CPTableColumn alloc] initWithIdentifier:@"column1"];
  14. [[tableColumn1 headerView] setStringValue:@"Column 1"];
  15. [tableView addTableColumn:tableColumn1];
  16. var tableColumn2 = [[CPTableColumn alloc] initWithIdentifier:@"column2"];
  17. [[tableColumn2 headerView] setStringValue:@"Column 2"];
  18. [tableView addTableColumn:tableColumn2];
  19. var tableColumn3 = [[CPTableColumn alloc] initWithIdentifier:@"column3"];
  20. [[tableColumn3 headerView] setStringValue:@"Column 3"];
  21. [tableView addTableColumn:tableColumn3];
  22. var tableColumn4 = [[CPTableColumn alloc] initWithIdentifier:@"column4"];
  23. [[tableColumn4 headerView] setStringValue:@"Column 4"];
  24. [tableView addTableColumn:tableColumn4];
  25. var tableColumn5 = [[CPTableColumn alloc] initWithIdentifier:@"column5"];
  26. [[tableColumn5 headerView] setStringValue:@"Column 5"];
  27. [tableView addTableColumn:tableColumn5];
  28. [scrollView setBackgroundColor:[CPColor blueColor]];
  29. [contentView addSubview:scrollView];
  30. [tableView setAutosaveTableColumns:YES];
  31. [tableView setAutosaveName:@"myAutosaveName"];
  32. [theWindow makeKeyAndOrderFront:self];
  33. }
  34. @end