Created
May 29, 2013 23:36
-
-
Save abhibeckert/5674679 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
@import <Foundation/CPObject.j> | |
@import "PageView.j" | |
@import "PhotoInspector.j" | |
@implementation AppController : CPObject | |
{ | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ | |
var theWindow = [[CPWindow alloc] | |
initWithContentRect:CGRectMakeZero() | |
styleMask:CPBorderlessBridgeWindowMask], | |
contentView = [theWindow contentView]; | |
[contentView setBackgroundColor:[CPColor blackColor]]; | |
[theWindow orderFront:self]; | |
var bounds = [contentView bounds], | |
pageView = [[PageView alloc] initWithFrame: | |
CGRectMake(CGRectGetWidth(bounds) / 2 | |
- 200, CGRectGetHeight(bounds) / 2 - 200, | |
400, 400)]; | |
[pageView setAutoresizingMask: CPViewMinXMargin | | |
CPViewMaxXMargin | | |
CPViewMinYMargin | | |
CPViewMaxYMargin]; | |
[contentView addSubview:pageView]; | |
var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()]; | |
[label setTextColor:[CPColor whiteColor]]; | |
[label setStringValue:@"Double Click to Edit Photo"]; | |
[label sizeToFit]; | |
[label setFrameOrigin:CGPointMake(CGRectGetWidth(bounds) / 2 - | |
CGRectGetWidth([label frame]) / 2, | |
CGRectGetMinY([pageView frame]) - | |
CGRectGetHeight([label frame]))]; | |
[label setAutoresizingMask: CPViewMinXMargin | | |
CPViewMaxXMargin | | |
CPViewMinYMargin | | |
CPViewMaxYMargin]; | |
[contentView addSubview:label]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment