Created
July 21, 2009 18:14
-
-
Save saikat/151498 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> | |
@import <AppKit/CPView.j> | |
@implementation AppController : CPObject | |
{ | |
CPTextField label; | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ | |
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask], | |
contentView = [theWindow contentView]; | |
label = [[CPTextField alloc] init]; | |
[label setStringValue:"Hello"]; | |
[label sizeToFit]; | |
[label setFrameOrigin:CGPointMake([contentView frame].size.width / 2.0 - [label frame].size.width / 2.0, [contentView frame].size.height / 2.0 - [label frame].size.height / 2.0)]; | |
[label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin]; | |
[label setEditable:YES]; | |
[label setSelectable:YES]; | |
[contentView addSubview:label]; | |
[[label window] makeFirstResponder:label]; | |
[label selectText:self]; | |
[theWindow orderFront:self]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment