Skip to content

Instantly share code, notes, and snippets.

@yllan
Created March 30, 2012 19:57
Show Gist options
  • Select an option

  • Save yllan/2254473 to your computer and use it in GitHub Desktop.

Select an option

Save yllan/2254473 to your computer and use it in GitHub Desktop.
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask];
var label = [[CPTextField alloc] initWithFrame:CGRectMake(100.0, 100.0, 150.0, 29.0)];
[label setStringValue:@"Hello World!"];
[label setEditable:YES];
[label setBezeled:YES];
[label setBordered:YES];
[[theWindow contentView] addSubview:label];
var panel = [[CPPanel alloc] initWithContentRect:CGRectMake(200.0, 200.0, 300.0, 300.0) styleMask:nil],
label2 = [[CPTextField alloc] initWithFrame:CGRectMake(100.0, 100.0, 150.0, 29.0)];
[label2 setPlaceholderString:@"Text Field"];
[label2 setEditable:YES];
[label2 setBezeled:YES];
[label2 setBordered:YES];
[[panel contentView] addSubview:label2];
[panel setInitialFirstResponder:label2];
[theWindow orderFront:self];
[panel orderFront:self];
[panel makeFirstResponder:label2];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment