Created
April 26, 2010 01:18
-
-
Save Me1000/378877 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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