Thank you for the reply! Yes, document-based.
However, not sure if it is an issue, but I have my own subclassed window controller. The docs also say that the default for "shouldCascadeWindows" is YES. I tried to set it to YES in "setShouldCascadeWindows:", without luck. I look at the EnhancedDataBurn example but it uses the origin of already shown window, which is slightly different than my case, I believe. On Tue, May 8, 2012 at 4:35 PM, Richard Somers <[email protected]>wrote: > On May 8, 2012, at 3:01 AM, ecir hana wrote: > > > I create a window like this: > > > > id window = [[[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 200, > > 200) styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered > > defer:NO] autorelease]; > > [window cascadeTopLeftFromPoint:NSMakePoint(20,20)]; > > > > but it cascades just vertically - the next window is positioned to the > very > > top left of my screen, the next one is just 20px lower (and 0px right), > the > > next one is again 20px lower than the previous one but it wont move > > horizontally. > > > > Why's that? Do I have to remember the returned NSPoint and pass it to > > next cascadeTopLeftFromPoint:? > > If I remember correctly you are using the document architecture. The > documentation has this to say. > > "If you use the Cocoa document architecture, you can use the > setShouldCascadeWindows: method of NSWindowController to set whether the > window, when it is displayed, should cascade in relation to other document > windows (that is, have a slightly offset location so that the title bars of > previously displayed windows are still visible). The default is true, so > typically you have no additional work to perform. > > If you are not using the document architecture, you can use the > cascadeTopLeftFromPoint: method ofNSWindow to cascade windows yourself. The > method returns a point shifted from the top-left corner of the window that > can be passed to a subsequent invocation of cascadeTopLeftFromPoint: to > position the next window so the title bars of both windows are fully > visible." > > > http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/WinPanel/Tasks/SizingPlacingWindows.html > > Have you examined the EnhancedDataBurn sample code? It has two examples of > where -[NSWindow cascadeTopLeftFromPoint:] is used. > > > http://developer.apple.com/library/mac/#samplecode/EnhancedDataBurn/Introduction/Intro.html > > --Richard > > _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
