Skip to content

Instantly share code, notes, and snippets.

@saikat
Created October 28, 2009 21:10
Show Gist options
  • Save saikat/220843 to your computer and use it in GitHub Desktop.
Save saikat/220843 to your computer and use it in GitHub Desktop.
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
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 setCenter:[contentView center]];
[contentView addSubview:label];
[theWindow orderFront:self];
// Uncomment the following line to turn on the standard menu bar.
[CPMenu setMenuBarVisible:YES];
}
- (void)copy:(CPMenuItem)anItem
{
console.log("Copy");
}
- (void)paste:(CPMenuItem)anItem
{
console.log("Paste");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment