• 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
NSWindow contentView buffer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSWindow contentView buffer


  • Subject: NSWindow contentView buffer
  • From: "ad veloper" <email@hidden>
  • Date: Fri, 14 Sep 2007 10:18:01 +0100

I'm playing with the snippet found at this post:

http://www.cocoabuilder.com/archive/message/cocoa/2002/5/13/62007

Why doesn't retaining the contentView work for my custom view, but is
okay for all the others? Also, if I don't retain my view when I
setContentView: the app crashes after the 1st run.

My aim is to toggle fullscreen, but rather than all content appearing
in full screen, restrict it to my custom view.

Any ideas?

- (IBAction)toggleFullScreen:(id)sender
{
	if (_windowBuffer) {
		[[NSNotificationCenter defaultCenter]
postNotificationName:SCIWindowControllerWillLeaveFullScreenMode
object:self];
		window = [self window];
		[_windowBuffer setContentView:_contentViewBuffer];
		[self setWindow:_windowBuffer];
		[window release];
		window = _windowBuffer;
		[_contentViewBuffer release];
		_windowBuffer = nil;
	}
	else {
		[[NSNotificationCenter defaultCenter]
postNotificationName:SCIWindowControllerWillEnterFullScreenMode
object:self];

		_windowBuffer = [[self window] retain];
		_contentViewBuffer = [[[self window] contentView] retain];

		[_windowBuffer orderOut:nil];
		window = [[SCIFullScreenWindow alloc]
initWithContentRect:[[_windowBuffer screen] frame]
														styleMask:NSBorderlessWindowMask
														  backing:NSBackingStoreBuffered
															defer:YES
														   screen:[_windowBuffer screen]];

		[window setLevel:NSMainMenuWindowLevel + 1];
		[window setContentView:view];	//IBOutlet to my custom view
		[self setWindow:window];
	}

	[self windowWillResize:[self window] toSize:[[self window] frame].size];
	[self showWindow:nil];
}
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: resetting ivars safely
  • Next by Date: Getting access to the name of a button?
  • Previous by thread: Re: Novice Question: Getting Menu selections
  • Next by thread: Getting access to the name of a button?
  • Index(es):
    • Date
    • Thread