Created
May 22, 2011 20:23
-
-
Save Synvox/985850 to your computer and use it in GitHub Desktop.
Cappuccino Instance Variables Problem
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
/* | |
* Event.j | |
* Canvas Creator | |
* | |
* Created by Ryan on May 21th, 2011. | |
* Copyright 2011, Synvox rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@import <AppKit/CPView.j> | |
@import "EventsView.j" | |
@import "Action.j" | |
@implementation Event : CPView | |
{ | |
CPMutableArray actions; | |
} | |
-(id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) | |
{ | |
actions = [[CPMutableArray alloc] init]; | |
[actions addObject:[[Action alloc] initWithType:@"Something"]]; | |
[self setBackgroundColor:[CPColor colorWithCalibratedRed:.95 green:.95 blue:.95 alpha:1]]; | |
} | |
alert(actions.length); | |
return self; | |
} | |
- (void)setSelected:(BOOL)isSelected | |
{ | |
if (isSelected){ | |
[self select]; | |
} else { | |
[self deselect] | |
} | |
} | |
-(void)select | |
{ | |
[self setBackgroundColor:[CPColor colorWithCalibratedRed:.35 green:.60 blue:.85 alpha:1]]; | |
alert(actions.length); | |
[[self eventView] view:actions]; | |
} | |
-(void)deselect | |
{ | |
[self setBackgroundColor:[CPColor colorWithCalibratedRed:.95 green:.95 blue:.95 alpha:1]]; | |
} | |
-(EventsView)eventView | |
{ | |
return [[[[self superview] superview] superview] superview]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment