Re: make a window fullscreen and back?
Re: make a window fullscreen and back?
- Subject: Re: make a window fullscreen and back?
- From: John Stiles <email@hidden>
- Date: Mon, 19 Jun 2006 10:30:01 -0700
I think you can make a new window and move over all the existing
views into the new window. It's not as bad as it sounds. :)
On Jun 19, 2006, at 5:54 AM, Sebi wrote:
does anybody know how to make an existing window (with title bar
and all) into a fullscreen window and back? i think i would have to
make it into a borderless window, but apparently there is no
setStyle: method in the NSWindow class. the style can only be set
in the init method, can't it?
right now i try the following (i'm calling this from within my view
class)
- (void)enterFullScreen {
NSScreen* mainScreen = [NSScreen mainScreen];
NSDictionary* screenInfo = [mainScreen deviceDescription];
NSNumber* screenID = [screenInfo objectForKey:@"NSScreenNumber"];
CGDirectDisplayID displayID = (CGDirectDisplayID)[screenID
longValue];
CGDisplayErr err = CGDisplayCapture(displayID);
if (err == CGDisplayNoErr) {
SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar);
NSWindow* window = [self window];
NSRect winRect = [mainScreen frame];
winRect = [NSWindow frameRectForContentRect:winRect styleMask:
[window styleMask]];
[window setShowsResizeIndicator:NO];
[window setLevel: CGShieldingWindowLevel()];
[window setFrame:winRect display:YES];
[window makeKeyAndOrderFront:self];
[self setNeedsDisplay:YES];
}
}
but i can't get rid of the windows title bar. what to do?
thanks + regards,
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden