Re: Full screen borderless window
Re: Full screen borderless window
- Subject: Re: Full screen borderless window
- From: Bob Smith <email@hidden>
- Date: Fri, 2 Apr 2004 18:47:38 -0800
Using NSBorderlessWindowMask has problems if you want the user to be
able to interact with the window's content. An NSWindow created that
way cannot receive key events, has to be closed explicitly (command-W
doesn't work because the window has no close button), and will not
appear in the Windows menu automatically (setTitle doesn't work because
the window has no title bar). If you want more than just a place to
display something non-interactive, you have to subclass NSWindow. One
technique appropriate for something like a game is described here:
http://cocoadevcentral.com/articles/000028.php
Another technique is to override just one NSWindow method, thus:
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen
*)aScreen
{
return(frameRect);
}
This stops the window from refusing to allow it's title bar to be moved
off-screen. Then you can initialize a titled, closable window with
it's content frame equal to the screen frame, and combined with hiding
the menu bar, you get what appears to be a full-screen window, but is
really just an ordinary window with it's peripheral elements hidden off
the edges of the screen.
Bob S.
On Apr 2, 2004, at 9:29 AM, Jirka Jirout wrote:
How do you create a full screen borderless window such as DVD Player
uses in full screen mode?
use NSBorderlessWindowMask as styleMask in NSWindow's
initWithContentRect:styleMask:backing:defer:
to get a borderless window and use the size of the screen as the
window's frame rectangle to make it full screen...
jj
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.