Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically make an NSWindow fullscreen using Lion?

For Lion development, I want to programmatically make an NSWindow fullscreen, and back to normal, exactly as if the user clicked on the fullscreen button.

I tried setStyleMask: (which I saw can be used for checking), but it only resulted in the title bar disappearing.

like image 968
personak Avatar asked Jan 10 '12 05:01

personak


1 Answers

You need to call -toggleFullScreen: on the window you want to change after you've configured everything for full screen.

like image 149
Jason Coco Avatar answered Nov 15 '22 13:11

Jason Coco