Skip to content

Instantly share code, notes, and snippets.

@j4johnfox
Created June 4, 2009 23:45
Show Gist options
  • Save j4johnfox/123932 to your computer and use it in GitHub Desktop.
Save j4johnfox/123932 to your computer and use it in GitHub Desktop.
- (void)configureThumbnailScroller
{
[thumbnailsContainerView setBackgroundColor:[CPColor blackColor]];
var photosListItem = [[CPCollectionViewItem alloc] init];
[photosListItem setView:[[MMSPhotoCell alloc] initWithFrame:CGRectMakeZero()]];
photosCollectionView = [[CPCollectionView alloc] initWithFrame:CGRectMake(0, 0,
([thumbnailsScrollView frame].size.width), [thumbnailsScrollView frame].size.height)];
[photosCollectionView setDelegate:self];
[photosCollectionView setMinItemSize:CGSizeMake(90, 90)];
[photosCollectionView setMaxItemSize:CGSizeMake(90, 90)];
[photosCollectionView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[photosCollectionView setMaxNumberOfRows:1];
[photosCollectionView setMaxNumberOfColumns:0];
[photosCollectionView setVerticalMargin:0.0];
[photosCollectionView setItemPrototype:photosListItem];
[thumbnailsScrollView setDocumentView:photosCollectionView];
[thumbnailsScrollView setHasHorizontalScroller:YES];
[thumbnailsScrollView setHasVerticalScroller:NO];
[thumbnailsContainerView setHidden:YES];
var thumbnailContainerFrame = CGRectCreateCopy([thumbnailsContainerView frame]);
thumbnailContainerFrame.size.width = [[[CPApp mainWindow] contentView] frame].size.width;
[thumbnailsContainerView setFrame:thumbnailContainerFrame];
[[[CPApp mainWindow] contentView] addSubview:thumbnailsContainerView];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment