Created
April 28, 2013 02:27
-
-
Save rtsuk/5475613 to your computer and use it in GitHub Desktop.
Here's how I do full screen. My windows are fixed size so you'll probably want to restore the window size as well.
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
-(IBAction)toggleFullScreen:(id)sender | |
{ | |
NSWindow* myWindow = self.window; | |
self.fullScreen = !self.fullScreen; | |
if (self.fullScreen) { | |
_normalWindowMask = [myWindow styleMask]; | |
_normalWindowLevel = [myWindow level]; | |
NSRect mainDisplayRect = [[NSScreen mainScreen] frame]; | |
[myWindow setStyleMask: NSBorderlessWindowMask]; | |
[myWindow setLevel: NSMainMenuWindowLevel + 1]; | |
[myWindow setFrame: mainDisplayRect display: YES animate: NO]; | |
[myWindow setOpaque: YES]; | |
} else { | |
[myWindow setStyleMask: _normalWindowMask]; | |
[myWindow setLevel: _normalWindowLevel]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment