PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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