Created
September 25, 2008 18:48
-
-
Save nickjs/12895 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 LEStack : CPView | |
{ | |
CPDictionary collection; | |
CPCollectionView grid; | |
} | |
- (LEStack)initWithOrigin:(CGPoint)aPoint | |
{ | |
self = [super initWithFrame:CGRectMake(0,0,500,500)]; | |
[self setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable]; | |
[self setHidden:YES]; | |
grid = [[CPCollectionView alloc] initWithFrame:CGRectMakeZero()]; | |
[grid setDelegate:self]; | |
[grid setMinItemSize:CGSizeMake(150,150)]; | |
[grid setMaxItemSize:CGSizeMake(150,150)]; | |
[self addSubview:grid]; | |
return self; | |
} | |
} | |
- (void)setCollection:(CPDictionary)aDict | |
{ | |
var item = [[CPCollectionViewItem alloc] init]; | |
[item setView:[[LEStackItem alloc] initWithFrame:CGRectMake(0,0,150,150)]]; | |
[grid setItemPrototype:item]; | |
[grid setContent:[[aDict allValues] copy]]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment