Created
March 12, 2010 19:10
-
-
Save boucher/330641 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 AvailableSceneView : CPImageView | |
{ | |
} | |
- (void)setRepresentedObject:(id)anObject | |
{ | |
[self setImage:anObject]; | |
} | |
@end | |
////// OR | |
@implementation CPControl (CollectionView) | |
- (void)setRepresentedObject:(id)anObject | |
{ | |
[self setObjectValue:anObject]; | |
} | |
@end |
This file contains hidden or 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
- somewhere | |
{ | |
item = [[CPCollectionViewItem alloc] init]; | |
[item setView:[[AvailableSceneView alloc] init]]; | |
//etc. | |
[collectionView setDelegate:self]; | |
[collectionView setItemPrototype:item]; | |
} | |
- (void)collectionViewDidChangeSelection:(CPCollectionView)aCollectionView | |
{ | |
//grab the new selected index, do something with it | |
} | |
- (void)collectionView:(CPCollectionView)aCollectionView dragTypesForItemsAtIndexes:(CPIndexSet)indexes | |
{ | |
//return drag types | |
} | |
- (void)collectionView:(CPCollectionView)aCollectionView dataForItemsAtIndexes:(CPIndexSet)indexes forType:(CPString)aType | |
{ | |
//return the data of this type at this index | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment