Skip to content

Instantly share code, notes, and snippets.

@richcollins
Created September 23, 2008 09:49
Show Gist options
  • Save richcollins/12253 to your computer and use it in GitHub Desktop.
Save richcollins/12253 to your computer and use it in GitHub Desktop.
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];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment