I'm trying to toggle off full screen on window 1 and order it out then order window 2 front into the same location and size window 1 used to be, everything is working but after exiting full screen window 1 is not closing.
Code:
- (IBAction)myaction:(id)sender {
// toggl off full screen if in full screen//
if (([self.window styleMask] & NSFullScreenWindowMask)){
[self.window toggleFullScreen:nil];
}
// set the second window size and location to be same as first window
NSRect frame = [_window frame];
[self.window2 setFrame:frame display:YES animate:NO];
// open second window and close first window
[_window2 orderFront:self];
[_window orderOut:self];
}