Skip to content

Instantly share code, notes, and snippets.

@inklesspen
Created March 23, 2009 20:26
Show Gist options
  • Save inklesspen/83755 to your computer and use it in GitHub Desktop.
Save inklesspen/83755 to your computer and use it in GitHub Desktop.
/*
* AppController.j
*
* Created by __Me__ on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*/
@import <Foundation/CPObject.j>
@import "Tile.j"
@import "TilePreview.j"
@import "TilePanel.j"
@import "TileDocumentView.j"
@import "TileSquare.j"
@import "TileScrollView.j"
@import "TileView.j"
@implementation AppController : CPObject
{
TilePanel _tilePanel;
CPMenu _mainMenu;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theApp = [aNotification object];
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
[theWindow orderFront:self];
var tileCollection = [[TileScrollView alloc] initWithFrame:[contentView bounds]];
[contentView addSubview: tileCollection];
[tileCollection setFrame:[contentView bounds]];
[tileCollection setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
_tilePanel = [[TilePanel alloc] init];
_mainMenu = [[CPMenu alloc] initWithTitle:"foo"];
var saveItem = [_mainMenu addItemWithTitle:"Save" action:@selector(saveMap) keyEquivalent: nil];
[theApp setMainMenu: _mainMenu];
[CPMenu setMenuBarVisible:YES];
var yPos = [_mainMenu menuBarHeight];
var xPos = [theWindow frame].size.width - 400;
[_tilePanel setFrameOrigin: CGPointMake(xPos, yPos)];
[_tilePanel orderFront:nil];
}
- (void)saveMap
{
console.log("THIS IS HAPPENING");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment