Skip to content

Instantly share code, notes, and snippets.

@chandlerkent
Created March 18, 2009 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chandlerkent/81139 to your computer and use it in GitHub Desktop.
Save chandlerkent/81139 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],
contentView = [theWindow contentView];
var secureTextField = [[CPSecureTextField alloc] initWithFrame:CGRectMakeZero()];
[secureTextField setEditable:YES];
[secureTextField setStringValue:@"Hello World"];
[secureTextField setFont:[CPFont boldSystemFontOfSize:24.0]];
[secureTextField sizeToFit];
[secureTextField setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
[secureTextField setFrameOrigin:CGPointMake((CGRectGetWidth([contentView bounds]) - CGRectGetWidth([secureTextField frame])) / 2.0, (CGRectGetHeight([contentView bounds]) - CGRectGetHeight([secureTextField frame])) / 2.0)];
[contentView addSubview:secureTextField];
[theWindow orderFront:self];
// Uncomment the following line to turn on the standard menu bar.
//[CPMenu setMenuBarVisible:YES];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment