Guest User

Untitled

a guest
May 27th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. /*
  2. * AppController.j
  3. * testapp
  4. *
  5. * Created by You on June 6, 2010.
  6. * Copyright 2010, Your Company All rights reserved.
  7. */
  8.  
  9. @import <Foundation/CPObject.j>
  10. @import <AppKit/CPBezierPath.j>
  11.  
  12.  
  13. @implementation AView : CPView
  14.  
  15. - (void)drawRect:(CPRect)aRect
  16. {
  17. var aPath = [CPBezierPath bezierPath];
  18. [aPath moveToPoint:CPMakePoint(0.0, 0.0)];
  19. [aPath lineToPoint:CPMakePoint(10.0, 10.0)];
  20. [aPath curveToPoint:CPMakePoint(18.0, 21.0)
  21. controlPoint1:CPMakePoint(6.0, 2.0)
  22. controlPoint2:CPMakePoint(28.0, 10.0)];
  23.  
  24. [aPath stroke];
  25. }
  26. @end
  27.  
  28. @implementation AppController : CPObject
  29. {
  30. }
  31.  
  32. - (void)applicationDidFinishLaunching:(CPNotification)aNotification
  33. {
  34. var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
  35. contentView = [theWindow contentView];
  36.  
  37. var v = [[AView alloc] initWithFrame:CGRectMake(0,0,100,100)];
  38.  
  39. [contentView addSubview:v];
  40.  
  41. [theWindow orderFront:self];
  42. }
  43.  
  44. @end
Add Comment
Please, Sign In to add comment