Skip to content

Instantly share code, notes, and snippets.

Created March 18, 2009 14:12
What would you like to do?
test description
@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()];
// The offending call. When you move out of the text field, an error is thrown.
[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];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment