Skip to content

Commit

Permalink
Some updates to NewApplication.
Browse files Browse the repository at this point in the history
[cappuccino#137 state:resolved]

Reviewed by me.
  • Loading branch information
grempe authored and Francisco Ryan Tolmasky I committed Nov 13, 2008
1 parent 9e8eff4 commit 6e15ce0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
24 changes: 15 additions & 9 deletions Tools/NewApplication/AppController.j
@@ -1,5 +1,11 @@
/*
* AppController.j
*
* Created by __Me__ on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*/

import <Foundation/CPObject.j>
@import <Foundation/CPObject.j>


@implementation AppController : CPObject
Expand All @@ -10,23 +16,23 @@ import <Foundation/CPObject.j>
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];

var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];

[label setStringValue:@"Hello World!"];
[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)];

[contentView addSubview:label];

[theWindow orderFront:self];

// Uncomment the following line to turn on the standard menu bar.
//[CPMenu setMenuBarVisible:YES];
}

@end
@end
20 changes: 10 additions & 10 deletions Tools/NewApplication/main.j
@@ -1,15 +1,15 @@
//
// main.j
// PhotoAlbum
//
// Created by Francisco Tolmasky on July 18th, 2008.
// Copyright 2005 - 2008, 280 North, Inc. All rights reserved.
//
/*
* main.j
*
* Created by __Me__ on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*/

import <Foundation/Foundation.j>
import <AppKit/AppKit.j>
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>

@import "AppController.j"

import "AppController.j"

function main(args, namedArgs)
{
Expand Down

0 comments on commit 6e15ce0

Please sign in to comment.