Created
January 9, 2010 11:02
-
-
Save RonchettiAssociati/272852 to your computer and use it in GitHub Desktop.
This file contains 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 | |
* WktTest62 | |
* | |
* Created by Bruno Ronchetti on Janurary 9, 2010. | |
* Copyright 2010, Ronchetti & Associati 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 button1 = [[CPButton alloc] initWithFrame:CGRectMake(10,10,100,24)]; | |
[button1 setTitle:"Button 1"]; | |
[button1 setTag:"Data Associated with Button 1"]; | |
[button1 setTarget:self]; | |
[button1 setAction:"pressed:"]; | |
[contentView addSubview:button1]; | |
var button2 = [[CPButton alloc] initWithFrame:CGRectMake(10,60,100,24)]; | |
[button2 setTitle:"Button 2"]; | |
[button2 setTag:"Data Associated with Button 2"]; | |
[button2 setTarget:self]; | |
[button2 setAction:"pressed:"]; | |
[contentView addSubview:button2]; | |
var button3 = [[CPButton alloc] initWithFrame:CGRectMake(10,110,100,24)]; | |
[button3 setTitle:"Button 3"]; | |
[button3 setTag:button1]; | |
[button3 setTarget:self]; | |
[button3 setAction:"pressed:"]; | |
[contentView addSubview:button3]; | |
label = [[CPTextField alloc] initWithFrame:CGRectMake(10,160,300,24)]; | |
[label setStringValue:@"Hello World!"]; | |
[label setFont:[CPFont systemFontOfSize:18]]; | |
[label sizeToFit]; | |
[contentView addSubview:label]; | |
[theWindow orderFront:self]; | |
} | |
-(void)pressed:(CPButton)aSender | |
{ | |
[label setStringValue:[aSender tag]]; | |
[label sizeToFit]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment