Created
January 12, 2010 18:09
-
-
Save boucher/275416 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
/* | |
* AppController.j | |
* keyviewloop2 | |
* | |
* Created by Ross Boucher on January 12, 2010. | |
* Copyright 2010, Your Company All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@implementation AppController : CPObject | |
{ | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ | |
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask], | |
contentView = [theWindow contentView]; | |
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()]; | |
LABEL1 = label; | |
[label setStringValue:@"Hello World!"]; | |
[label setFont:[CPFont boldSystemFontOfSize:24.0]]; | |
[label setBezeled:YES]; | |
[label sizeToFit]; | |
[label setEditable:YES]; | |
[label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin]; | |
[label setCenter:[contentView center]]; | |
[contentView addSubview:label]; | |
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()]; | |
LABEL2 = label; | |
[label setStringValue:@"Hello World!"]; | |
[label setFont:[CPFont boldSystemFontOfSize:24.0]]; | |
[label setBezeled:YES]; | |
[label sizeToFit]; | |
[label setEditable:YES]; | |
[label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin]; | |
[label setCenter:CGPointMake([contentView center].x, [contentView center].y + 40)]; | |
[contentView addSubview:label]; | |
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()]; | |
LABEL3 = label; | |
[label setStringValue:@"Hello World!"]; | |
[label setFont:[CPFont boldSystemFontOfSize:24.0]]; | |
[label setBezeled:YES]; | |
[label sizeToFit]; | |
[label setEditable:YES]; | |
[label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin]; | |
[label setCenter:CGPointMake([contentView center].x, [contentView center].y - 40)]; | |
[contentView addSubview:label]; | |
[theWindow orderFront:self]; | |
// THESE LINES MANIPULATE THE KEY VIEW LOOP | |
[theWindow setAutorecalculatesKeyViewLoop:NO]; | |
[LABEL1 setNextKeyView:LABEL3]; | |
[LABEL3 setNextKeyView:LABEL1]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment