• 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: Question re: [NSWindow setFrame:display:]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Question re: [NSWindow setFrame:display:] (From: email@hidden)

  • Prev by Date: NSButton not responding to click in worker thread
  • Next by Date: Re: NSButton not responding to click in worker thread
  • Previous by thread: Question re: [NSWindow setFrame:display:]
  • Next by thread: NSButton not responding to click in worker thread
  • Index(es):
    • Date
    • Thread