Skip to content

Instantly share code, notes, and snippets.

@hammerdr
Created February 8, 2010 06:48
Show Gist options
  • Save hammerdr/297941 to your computer and use it in GitHub Desktop.
Save hammerdr/297941 to your computer and use it in GitHub Desktop.
/*
* AppController.j
* ScrollViewBug
*
* Created by You on February 8, 2010.
* Copyright 2010, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
var aView = [[CPView alloc] initWithFrame:CGRectMakeZero()];
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMakeZero()];
[scrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
var textField = [CPTextField labelWithTitle:@"Test"];
[scrollView setDocumentView:textField];
[aView addSubview:scrollView];
[contentView addSubview:aView];
[theWindow orderFront:self];
[aView setFrame:CGRectMake(0, 0, 500, 500)];
// Uncomment the following line to turn on the standard menu bar.
//[CPMenu setMenuBarVisible:YES];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment