Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save chandlerkent/167582 to your computer and use it in GitHub Desktop.

Select an option

Save chandlerkent/167582 to your computer and use it in GitHub Desktop.
/*
* AppController.j
* NewApplication
*
* Created by You on July 5, 2009.
* Copyright 2009, 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 textField = [CPTextField textFieldWithStringValue:@"" placeholder:@"Test1" width:100];
[textField setDelegate:self];
[textField setCenter:[contentView center]];
[contentView addSubview:textField];
[theWindow orderFront:self];
// Uncomment the following line to turn on the standard menu bar.
//[CPMenu setMenuBarVisible:YES];
}
- (void)controlTextDidEndEditing:(CPNotification)notification
{
alert("lost focus");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment