Created
November 2, 2009 18:39
-
-
Save wilkes/224334 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
/* | |
* AppController.j | |
* scrollview | |
* | |
* Created by You on November 2, 2009. | |
* Copyright 2009, Your Company All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@implementation AppController : CPObject | |
{ | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ | |
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(40, 40, 400,200) | |
styleMask:CPResizableWindowMask | CPTitledWindowMask | CPClosableWindowMask | CPMiniaturizableWindowMask], | |
contentView = [theWindow contentView]; | |
[contentView setBackgroundColor: [CPColor yellowColor]]; | |
// This doesn't work | |
var scrollView = [[CPScrollView alloc] initWithFrame:[contentView bounds]]; | |
// This works... | |
//var scrollView = [[CPButton alloc] initWithFrame: [contentView bounds]]; | |
[scrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable]; | |
[contentView addSubview:scrollView]; | |
[scrollView setBackgroundColor: [CPColor greenColor]]; | |
[theWindow orderFront:self]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment