Created
March 25, 2009 08:06
-
-
Save tbalthazar/85362 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 | |
* | |
* Created by __Me__ on __Date__. | |
* Copyright 2008 __MyCompanyName__. 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 = [[CPSecureTextField alloc] initWithFrame:CGRectMakeZero()]; | |
[label setStringValue:@"Hello World!"]; | |
[label setPlaceholderString:@"Your password"] ; | |
[label setBordered:YES] ; | |
[label setBezeled:YES] ; | |
[label setBezelStyle:CPTextFieldSquareBezel] ; | |
[label setFont:[CPFont boldSystemFontOfSize:24.0]]; | |
[label sizeToFit]; | |
[label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin]; | |
[label setFrameOrigin:CGPointMake((CGRectGetWidth([contentView bounds]) - CGRectGetWidth([label frame])) / 2.0, (CGRectGetHeight([contentView bounds]) - CGRectGetHeight([label frame])) / 2.0)]; | |
var secureText = [[CPSecureTextField alloc] initWithFrame:CGRectMake(10.0, 40.0, 240.0, 18.0)]; | |
[secureText setBezeled:YES] ; | |
[secureText setBezelStyle:CPTextFieldSquareBezel] ; | |
[contentView addSubview:secureText]; | |
[contentView addSubview:label]; | |
[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