Skip to content

Instantly share code, notes, and snippets.

@Me1000
Created April 26, 2010 01:18
Show Gist options
  • Select an option

  • Save Me1000/378877 to your computer and use it in GitHub Desktop.

Select an option

Save Me1000/378877 to your computer and use it in GitHub Desktop.
/*
* AppController.j
* doubleclick
*
* Created by You on April 25, 2010.
* Copyright 2010, Randy Luecke All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
var view = [[blah alloc] initWithFrame:CGRectMake(100,100, 500,500)];
[view setBackgroundColor:[CPColor redColor]];
[view setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
[view setCenter:[contentView center]];
[contentView addSubview:view];
[theWindow orderFront:self];
// Uncomment the following line to turn on the standard menu bar.
//[CPMenu setMenuBarVisible:YES];
}
@end
@implementation blah : CPView
{
}
- (void)mouseDown:(CPEvent)anEvent
{
console.log(anEvent);
if ([anEvent clickCount] === 2)
alert("DOUBLE");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment