Re: resizing a window before displaying, SOLVED
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.