Created
December 3, 2010 06:15
-
-
Save fernyb/726647 to your computer and use it in GitHub Desktop.
Borderless NSWindow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (id)initWithContentRect:(NSRect)contentRect | |
styleMask:(NSUInteger)windowStyle | |
backing:(NSBackingStoreType)bufferingType | |
defer:(BOOL)deferCreation | |
{ | |
[super initWithContentRect:contentRect | |
styleMask:NSBorderlessWindowMask | |
backing:bufferingType | |
defer:deferCreation]; | |
[self setBackgroundColor:[NSColor clearColor]]; | |
[self setOpaque:NO]; | |
[self setAllowsConcurrentViewDrawing:YES]; | |
[self setAcceptsMouseMovedEvents:YES]; | |
[self setHasShadow:NO]; | |
[self setLevel:NSFloatingWindowLevel]; | |
CGFloat pointX = ([[NSScreen mainScreen] frame].size.width - [self frame].size.width) - 20; | |
CGFloat pointY = ([[NSScreen mainScreen] frame].size.height - [self frame].size.height) - 30; | |
[self setFrameOrigin:NSMakePoint(pointX, pointY)]; | |
return self; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment