• 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: Resize NSWindow Programatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resize NSWindow Programatically


  • Subject: Re: Resize NSWindow Programatically
  • From: Dimitri Bouniol <email@hidden>
  • Date: Mon, 4 Sep 2006 22:22:45 -0700

NSWindow has the following method: - (void)setFrame:(NSRect) windowFrame display:(BOOL)displayViews animate:(BOOL)performAnimation
which might be appropriate for the disclosure.:


IBOutlet NSWindow *theWindow;
float nameInfoHeight;
float nameInfoWidth;
BOOL displayViews = YES; // Set if you want views to be redrawn.

-(IBAction)toggleNameInfo:(id)sender
{
NSRect newFrame;
	if([nameView isHidden])
	{
		[nameView setHidden:NO];
		newFrame.origin.x = [theWindow frame].origin.x;
		newFrame.origin.y = [theWindow frame].origin.y - nameInfoHeight;
		newFrame.size.width = [theWindow frame].size.width + nameInfoWidth;
		newFrame.size.height = [theWindow frame].size.height + nameInfoHeight;
	}
	else
	{
		[nameView setHidden:YES];
		newFrame.origin.x = [theWindow frame].origin.x;
		newFrame.origin.y = [theWindow frame].origin.y + nameInfoHeight;
		newFrame.size.width = [theWindow frame].size.width - nameInfoWidth;
		newFrame.size.height = [theWindow frame].size.height - nameInfoHeight;
}
[theWindow setFrame:newFrame display:displayViews animate:YES];
}


Hope that works : )
--
The world's biggest Apple fan,
Dimitri Bouniol
email@hidden


_______________________________________________ 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: 
 >Resize NSWindow Programatically (From: Brian Amerige <email@hidden>)

  • Prev by Date: Cocoa Browser
  • Next by Date: Cocoa equivalent to fputc()?
  • Previous by thread: Re: Resize NSWindow Programatically
  • Next by thread: Re: Resize NSWindow Programatically
  • Index(es):
    • Date
    • Thread