Created
September 8, 2008 05:03
-
-
Save richcollins/9377 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
import <Foundation/CPObject.j> | |
@implementation AppController : CPObject | |
{ | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ | |
var theWindow = [[CPWindow alloc] | |
initWithContentRect:CGRectMakeZero() | |
styleMask:CPBorderlessBridgeWindowMask | |
] | |
var contentView = [theWindow contentView]; | |
var theImage = [[CPImage alloc] initByReferencingFile:"cappuccino-icon.png" size:CPSizeMake(300, 300)]; | |
var imageView = [[CPImageView alloc] initWithFrame:CGRectMake(0, 0, 300, 300)]; | |
[imageView setImage: theImage]; | |
var collectionView = [[CPCollectionView alloc] initWithFrame:CGRectMake( | |
CGRectGetWidth([contentView bounds])/2.0 - 450, CGRectGetHeight([contentView bounds])/2.0 - 150, | |
900, 150 | |
)]; | |
var collection = [imageView, imageView, imageView]; | |
[collectionView setContent: [CPArray arrayWithArray:collection]]; | |
[contentView addSubview:collectionView]; | |
/* | |
var outerScrollView = [[CPScrollView alloc] initWithFrame:CGRectMake( | |
CGRectGetWidth([contentView bounds])/2.0 - 450, CGRectGetHeight([contentView bounds])/2.0 - 75, | |
900, 150 | |
)]; | |
[outerScrollView setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin]; | |
[outerScrollView setDocumentView: imageView]; | |
[outerScrollView setHasHorizontalScroller: NO]; | |
for(var i = 0; i < 6; i++) | |
{ | |
} | |
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake( | |
CGRectGetWidth([contentView bounds])/2.0 - 75, CGRectGetHeight([contentView bounds])/2.0 - 75, | |
150, 150 | |
)]; | |
[scrollView setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin]; | |
[scrollView setDocumentView: imageView]; | |
[scrollView setHasHorizontalScroller: NO]; | |
[contentView addSubview: scrollView];*/ | |
[theWindow orderFront:self]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment