make a window fullscreen and back?
make a window fullscreen and back?
- Subject: make a window fullscreen and back?
- From: Sebi <email@hidden>
- Date: Mon, 19 Jun 2006 14:54:57 +0200
hello all,
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,
sebastian mecklenburg
_______________________________________________
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