Skip to content

Instantly share code, notes, and snippets.

@toddfreese
Created April 21, 2011 17:21
Show Gist options
  • Select an option

  • Save toddfreese/935031 to your computer and use it in GitHub Desktop.

Select an option

Save toddfreese/935031 to your computer and use it in GitHub Desktop.
/*
* AppController.j
* Testing
*
* Created by You on April 21, 2011.
* Copyright 2011, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask];
var contentView = [theWindow contentView];
var backgroundImageView = [[CPImageView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([contentView bounds]), CGRectGetHeight([contentView bounds]))];
[backgroundImageView setImage:[[CPImage alloc] initWithContentsOfFile:@"http://a.filmworkers.com/VIT_BG_04.jpg" size:CGSizeMake(2560, 1600)]];
[backgroundImageView setImageScaling:CPScaleNone];
[backgroundImageView setHasShadow:NO];
[backgroundImageView setImageAlignment:CPImageAlignLeft];
[backgroundImageView setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin | CPViewWidthSizable | CPViewHeightSizable];
[contentView addSubview:backgroundImageView];
[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