Hi:
I have a program running which uses fullscreen mode also- that is I can go full screen as well. I have a custom view in this window (where I show some opengl stuff) and some buttons/controls..
The problem is this..
Once I go to the fullscreen and come back, my normal sized window cannot display the custom view but only displays the normal window with controls and without the custom view itself..
I read somewhere that in order for any other views to be shown, they should be made subviews of the content view. I have no clue how to do that.
Also if anyone thinks there is another way around this, it could be helpful...
Below is the relevant part of the code...
---------
-(IBAction)fullScreenid)sender
{
if (fullScreenMode)
{
[fullScreenWindow close];
[startingWindow setAcceptsMouseMovedEvents:YES];
// [startingWindow setContentView:];
[startingWindow makeKeyAndOrderFront:nil];
// [startingWindow makeFirstResponder:myGLView];
fullScreenMode = NO;
} else
{
unsigned int windowStyle;
NSRect contentRect;
startingWindow = [NSApp keyWindow];
windowStyle = NSBorderlessWindowMask;
contentRect = [[NSScreen mainScreen] frame];
fullScreenWindow = [[NSWindow alloc] initWithContentRect:contentRect
styleMask:windowStyle
backing:NSBackingStoreBuffered
defer:NO];
[startingWindow setAcceptsMouseMovedEvents:NO];
if(fullScreenWindow != nil)
{
[fullScreenWindow setTitle"GL Viewer"];
[fullScreenWindow setReleasedWhenClosed:YES];
[fullScreenWindow setAcceptsMouseMovedEvents:YES];
[fullScreenWindow setContentView:myGLView];
[fullScreenWindow makeKeyAndOrderFront:myGLView];
[fullScreenWindow setLevel:NSScreenSaverWindowLevel -1];
[fullScreenWindow makeFirstResponder:myGLView];
fullScreenMode = YES;
}
}
}
I have a program running which uses fullscreen mode also- that is I can go full screen as well. I have a custom view in this window (where I show some opengl stuff) and some buttons/controls..
The problem is this..
Once I go to the fullscreen and come back, my normal sized window cannot display the custom view but only displays the normal window with controls and without the custom view itself..
I read somewhere that in order for any other views to be shown, they should be made subviews of the content view. I have no clue how to do that.
Also if anyone thinks there is another way around this, it could be helpful...
Below is the relevant part of the code...
---------
-(IBAction)fullScreenid)sender
{
if (fullScreenMode)
{
[fullScreenWindow close];
[startingWindow setAcceptsMouseMovedEvents:YES];
// [startingWindow setContentView:];
[startingWindow makeKeyAndOrderFront:nil];
// [startingWindow makeFirstResponder:myGLView];
fullScreenMode = NO;
} else
{
unsigned int windowStyle;
NSRect contentRect;
startingWindow = [NSApp keyWindow];
windowStyle = NSBorderlessWindowMask;
contentRect = [[NSScreen mainScreen] frame];
fullScreenWindow = [[NSWindow alloc] initWithContentRect:contentRect
styleMask:windowStyle
backing:NSBackingStoreBuffered
defer:NO];
[startingWindow setAcceptsMouseMovedEvents:NO];
if(fullScreenWindow != nil)
{
[fullScreenWindow setTitle"GL Viewer"];
[fullScreenWindow setReleasedWhenClosed:YES];
[fullScreenWindow setAcceptsMouseMovedEvents:YES];
[fullScreenWindow setContentView:myGLView];
[fullScreenWindow makeKeyAndOrderFront:myGLView];
[fullScreenWindow setLevel:NSScreenSaverWindowLevel -1];
[fullScreenWindow makeFirstResponder:myGLView];
fullScreenMode = YES;
}
}
}