• 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
Re: make a window fullscreen and back?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make a window fullscreen and back?


  • Subject: Re: make a window fullscreen and back?
  • From: "Shawn Erickson" <email@hidden>
  • Date: Mon, 19 Jun 2006 10:35:57 -0700

On 6/19/06, Sebi <email@hidden> wrote:

but i can't get rid of the windows title bar. what to do?

Make a borderless window (NSBorderlessWindowMask) and swap the content view from your normal window into the full screen window (or some aspect of the view hierarchy).

Quick example from a NSWindow subclass of mine (you don't have to do
it in a subclass)...

- (id) initForScreen:(NSScreen*)screen
{
   NSRect screenFrame = [screen frame];
   NSRect contentRect;
   contentRect.origin = NSZeroPoint;
   contentRect.size = [screen frame].size;

   self = [super initWithContentRect:contentRect
                           styleMask:NSBorderlessWindowMask
                             backing:NSBackingStoreBuffered
                               defer:YES
                              screen:screen];
   if (self != nil) {
       [self setReleasedWhenClosed:NO];
       [self setTargetScreen:screen];
   }

   return self;
}

//======================================================================================================================
// -canBecomeKeyWindow:
//
// By default NSBorderlessWindowMask styled windows report that they
cannot become the key (target of key board input)
// this override allows our full screen window to become the key window.
//======================================================================================================================
- (BOOL) canBecomeKeyWindow
{
   return YES;
}

//======================================================================================================================
// -canBecomeMainWindow:
//
// By default NSBorderlessWindowMask styled windows report that they
cannot become the main window this override
// allows our full screen window to become the main window.
//======================================================================================================================
- (BOOL) canBecomeMainWindow
{
   return YES;
}

-Shawn
_______________________________________________
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


References: 
 >make a window fullscreen and back? (From: Sebi <email@hidden>)

  • Prev by Date: Re: make a window fullscreen and back?
  • Next by Date: Re: Stopping an NSRunLoop OR getting NSDistributedNotificationCenter notifications
  • Previous by thread: Re: make a window fullscreen and back?
  • Next by thread: Re: Problem in simulating the events
  • Index(es):
    • Date
    • Thread