1
votes

I currently have a NSWindow that allows for full screen. The window has a video player and a playlist below it. When the user goes fullscreen, I want to get rid of the playlist and just show the video.

My first thoughts for doing this is to swap out the window when I detect a fullscreen entry point. I have found that I can detect this with the following:

- (void)windowWillEnterFullScreen:(NSNotification *)notification
{
    NSLog(@"My window is going fullscreen");
}

But I have been unable to figure out how to swap out the window for a new one at this point. One option I haven't yet attempted would be to modify all of the resizing flags of the video and hide the other components but I'm not certain if this would be the best solution.

Does anyone have any suggestions on a better way for doing this?

1
See similar question for one approach: stackoverflow.com/questions/9019178/…CRD

1 Answers

2
votes

Why do you want to swap the window? Just manipulate the views in the window.

Just remove the playlist from your view when you go fullscreen with -removeFromSuperview and then resize the video view so that it fills your window.

Make sure you hold a reference to the view as an ivar somewhere, because otherwise the view will be deallocated. You can then use that reference to add the view back when the window exits full-screen mode.