Created
March 23, 2009 16:33
-
-
Save allometry/83641 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
@import <Foundation/CPObject.j> | |
@import <AppKit/CPCib.j> | |
@implementation AppController : CPObject | |
{ | |
CPWindow _window; | |
IBOutlet id myTextBox; | |
IBOutlet id myWindow; | |
IBOutlet id myButton; | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ | |
var cib = [[CPCib alloc] initWithContentsOfURL:[[CPBundle mainBundle] pathForResource:@"MainMenu.cib"]]; | |
[cib instantiateCibWithExternalNameTable:[CPDictionary dictionaryWithObject:self forKey:CPCibOwner]]; | |
if([myTextBox isEditable]) | |
[myTextBox setStringValue:@"yes"]; | |
else | |
[myTextBox setStringValue:@"no"]; | |
[myTextBox setTextColor:[CPColor blueColor]]; | |
//This is what I was trying to accomplish!!! | |
[myWindow center]; | |
[_window setFrameOrigin:CGPointMake(0.0, 0.0)]; | |
[_window orderFront:self]; | |
} | |
-(IBAction)myButtonAction:(id)sender { | |
alert("hello"); | |
[myButton setTitle:@"Pressed"]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment