Re: resizing a window before displaying
Re: resizing a window before displaying
- Subject: Re: resizing a window before displaying
- From: Hua Ying Ling <email@hidden>
- Date: Wed, 10 Mar 2004 09:26:57 -0500
On Mar 9, 2004, at 11:45 AM, Allan Odgaard wrote:
On 9. Mar 2004, at 17:26, Hua Ying Ling wrote:
[[NSDocumentController sharedDocumentController]
openUntitledDocumentOfType:@"DocumentType" display:NO];
Is your app documented based? In that case simply overload
windowControllerDidLoadNib:, at least the window returns NO for
visible here.
Yes but from my experience both NSDocument's windowControllerDidLoadNib
and awakeFromNib are never called if you're using a custom
windowController.
Is there a better way to do this?
You might also try to implement awakeFromNib -- but I don't really
understand your code, because wouldn't it be you who send a
makeKeyAndOrderFront: to the window/window controller? So could you
not simply obtain [controller window] before opening the window, and
set the frame (the Nib will load on a request for the window)?
Maybe this would help, here's part of the backtrace:
5 com.apple.yourCocoaDocApp 0x00008050 -[MyWindowController
awakeFromNib] + 0x2c (MyWindowController.m:13)
6 com.apple.AppKit 0x92df1f58 -[NSIBObjectData
nibInstantiateWithOwner:topLevelObjects:] + 0x398
7 com.apple.AppKit 0x92e85fb8 old_loadNib + 0xf4
8 com.apple.AppKit 0x92e3aa78 +[NSBundle(NSNibLoading)
_loadNibFile:nameTable:withZone:ownerBundle:] + 0x35c
9 com.apple.AppKit 0x92eb972c +[NSBundle(NSNibLoading)
loadNibFile:externalNameTable:withZone:] + 0x9c
10 com.apple.AppKit 0x92ec0530 -[NSWindowController
loadWindow] + 0xcc
11 com.apple.AppKit 0x92e74ce0 -[NSWindowController window]
+ 0x5c
12 com.apple.AppKit 0x92f316c0 -[NSWindowController
showWindow:] + 0x24
13 com.apple.AppKit 0x92f3ca90 -[NSDocument showWindows] +
0x6c
14 com.apple.AppKit 0x92f3c4f4 -[NSDocumentController
openUntitledDocumentOfType:display:] + 0x84
So it seem like NSDocumentController is actually causing
makeKeyAndOrderFront: with showWindow: on line #12.
If you're suggesting I set the frame before the nib loads, the problem
I had with setting the frame before the nib loads is the views in the
nib won't resize properly.
Thanks for your suggestions
~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.