personak
personak

Reputation: 539

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.

Upvotes: 5

Views: 2566

Answers (1)

Jason Coco
Jason Coco

Reputation: 78393

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

Upvotes: 9

Related Questions