• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
make a window fullscreen and back?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: make a window fullscreen and back?
      • From: "Shawn Erickson" <email@hidden>
    • Re: make a window fullscreen and back?
      • From: John Stiles <email@hidden>
  • Prev by Date: Re: Detecting Illegitimate OS X Installations?
  • Next by Date: Re: Zlib compress & uncompress
  • Previous by thread: Re: Zlib compress & uncompress
  • Next by thread: Re: make a window fullscreen and back?
  • Index(es):
    • Date
    • Thread