Created
March 17, 2010 14:26
-
-
Save karlforshaw/335280 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
@implementation WizardController : CPWindowController | |
{ | |
} | |
/* | |
* Instance Init Method | |
*/ | |
- (WizardController)init | |
{ | |
var wizardWindow = [[WizardWindow alloc] init]; | |
var self = [super initWithWindow:wizardWindow]; | |
if (self) { | |
[self initQuestions]; | |
return self; | |
} | |
else | |
alert('Error, could not init Wizard Window'); | |
} | |
-(CFAction)showWindow:(id)aSender | |
{ | |
// Super show method | |
[super showWindow:aSender]; | |
// Don't really like this, but can't see a way around it | |
var startButton = [self window]._startButton; | |
[startButton setTarget:self]; | |
[startButton setAction:@selector(nextQuestion)]; | |
} | |
@end | |
@implementation WizardWindow : CPPanel | |
{ | |
CPButton _startButton; | |
} | |
- (WizardWindow)init | |
{ | |
var _startButton = [[CPButton alloc] initWithFrame:CGRectMake( | |
CGRectGetWidth(bounds) / 2 - 50, | |
0, | |
100, | |
18 | |
)]; | |
[_startButton setTitle:"Start the Wizard"]; | |
[[self contentView] addSubview:_buttonBar]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment