Guest User

Untitled

a guest
Apr 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. /*
  2. * AppController.j
  3. * scrollview
  4. *
  5. * Created by You on November 2, 2009.
  6. * Copyright 2009, Your Company All rights reserved.
  7. */
  8.  
  9. @import <Foundation/CPObject.j>
  10.  
  11.  
  12. @implementation AppController : CPObject
  13. {
  14. }
  15.  
  16. - (void)applicationDidFinishLaunching:(CPNotification)aNotification
  17. {
  18. var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(40, 40, 400,200)
  19. styleMask:CPResizableWindowMask | CPTitledWindowMask | CPClosableWindowMask | CPMiniaturizableWindowMask],
  20. contentView = [theWindow contentView];
  21.  
  22. [contentView setBackgroundColor: [CPColor yellowColor]];
  23.  
  24. // This doesn't work
  25. var scrollView = [[CPScrollView alloc] initWithFrame:[contentView bounds]];
  26.  
  27. // This works...
  28. //var scrollView = [[CPButton alloc] initWithFrame: [contentView bounds]];
  29.  
  30.  
  31. [scrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
  32. [contentView addSubview:scrollView];
  33. [scrollView setBackgroundColor: [CPColor greenColor]];
  34.  
  35. [theWindow orderFront:self];
  36. }
  37.  
  38. @end
Add Comment
Please, Sign In to add comment