gist: 12253 Download_button fork
public
Public Clone URL: git://gist.github.com/12253.git
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var theWindow = [[CPWindow alloc]
    initWithContentRect:CGRectMakeZero()
    styleMask:CPBorderlessBridgeWindowMask
  ];
  
  _contentView = [theWindow contentView];
  
  var bounds = [_contentView bounds];
  var boxSideLength = 10;
  var boxMargin = 10;
  
  var boxX = CPRectGetWidth(bounds) - boxMargin - boxSideLength;
  var boxY = CPRectGetHeight(bounds) - boxMargin - boxSideLength;
  
  var box = [[CPView alloc] initWithFrame:CPRectMake(boxX, boxY, boxSideLength, boxSideLength)];
  [box setBackgroundColor:[CPColor blackColor]];
  
  [box setAutoresizingMask:CPViewMinXMargin|CPViewMinYMargin];
  
  [_contentView addSubview:box];
  
  [theWindow orderFront:self];

Owner

richcollins

Revisions