• 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: resizing a window before displaying, SOLVED
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resizing a window before displaying, SOLVED


  • Subject: Re: resizing a window before displaying, SOLVED
  • From: Robert Martin <email@hidden>
  • Date: Thu, 11 Mar 2004 20:05:35 -0500

One thought: You might want to release windowController after adding it to the document's windowControllers.

If you don't, it will still be retained when you close your document. This can have nasty side effects, since the window will still be in the responder chain even though the document itself will be gone.

I may not be expressing this properly, but I hope you get the idea.



On Mar 11, 2004, at 6:01 PM, Hua Ying Ling wrote:

For anyone else having this annoying intermittent problem here's the solution for resizing a window full screen before showing it, credit goes to Allan Odgaard.

+ Subclass a NSWindowController, call it MyWindowController.
+ Add the following to MyDocument.m
- (void)makeWindowControllers
{
windowController = [[MyWindowController alloc] initWithWindowNibName:@"MyDocument"];
[windowController setShouldCascadeWindows:NO];
[self addWindowController:windowController];
}

+ Add this method to MyWindowController.m
- (void)windowDidLoad
{
NSLog(@"%s: %d", _cmd, [[self window] isVisible]);
NSRect screenFrame = [[NSScreen mainScreen] frame];

screenFrame.size.height = screenFrame.size.height + 22;
[[self window] setFrame:screenFrame display:YES];
}

Thanks for the solution and your time,
~Hua Ying
_______________________________________________
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.


References: 
 >resizing a window before displaying (From: Hua Ying Ling <email@hidden>)
 >Re: resizing a window before displaying (From: Allan Odgaard <email@hidden>)
 >Re: resizing a window before displaying (From: Hua Ying Ling <email@hidden>)
 >Re: resizing a window before displaying (From: Allan Odgaard <email@hidden>)
 >Re: resizing a window before displaying, SOLVED (From: Hua Ying Ling <email@hidden>)

  • Prev by Date: debugging a framework ?
  • Next by Date: Re: NSImageView drawing the NSImage...
  • Previous by thread: Re: resizing a window before displaying, SOLVED
  • Next by thread: How do I create a "small" radio button dynamically?
  • Index(es):
    • Date
    • Thread