Re: Question re: [NSWindow setFrame:display:]
Re: Question re: [NSWindow setFrame:display:]
- Subject: Re: Question re: [NSWindow setFrame:display:]
- From: Kyle Sluder <email@hidden>
- Date: Mon, 6 Apr 2009 02:29:31 -0400
On Mon, Apr 6, 2009 at 2:07 AM, <email@hidden> wrote:
> In my NSDocument subclass, I am trying to set the main window's frame in the
> windowControllerDidLoadNib: method. For some reason, I can set the width and
> height of the window's frame, but not its origin. Any ideas? I am using the
> setFrame:NSMakeRect(x, y, w, h) display:YES
See -[NSWindowController shouldCascadeWindows]. If you don't override
-[NSDocument makeWindowControllers], NSDocument makes one for you
(using the return value of -windowNibName), and the default behavior
of NSWindowController is, as the documentation says, to automatically
cascade the window.
The solution is to override -makeWindowControllers and create your own
NSWindowController, calling -setShouldCascadeWindows: as appropriate.
--Kyle Sluder
_______________________________________________
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