Re: Window "snapping" to main screen
Re: Window "snapping" to main screen
- Subject: Re: Window "snapping" to main screen
- From: Eric Matecki <email@hidden>
- Date: Mon, 21 May 2012 13:54:24 +0200
Thanks Quincy, this works !
On 07/05/12 11:56, Eric Matecki wrote:
On 07/05/12 09:39, Quincey Morris wrote:
On May 7, 2012, at 00:30 , Quincey Morris wrote:
On May 7, 2012, at 00:14 , Eric Matecki wrote:
mWindow = [[NSWindow alloc] initWithContentRect: contentSize styleMask: styleMask backing: NSBackingStoreBuffered defer: YES];
I would assume that the content rect is here assumed to be relative to the main screen. Have you tried
'initWithContentRect:styleMask:backing:defer:screen:' instead?
Er…having trouble saying what I mean today…
I meant to say that the content rect is assumed to be relative to the main screen, and windows are constrained to the boundaries
of their screen. Presumably specifying the screen via the alternative initializer will cause it to constrain to that screen, and
you can use a different contentRect if you want to position it directly.
If you want to defeat the constraining, for a specific screen, you have to subclass NSWindow and override
'constrainFrameRect:toScreen:' to do whatever you want.
Thanks Quincey, I will look at overriding constrainFrameRect:toScreen:
The content rect is relative to the main screen, that's what I want and what I get anyhow when calling:
[mWindow contentRectForFrameRect: [mWindow frame]].
So I assumed passing it back to the window initialization method will put my window back where it was.
--
Keep intel OUTSIDE my Mac !
Hiii !!! I can see Intel chips creeping around my G5 !
Eric M.
_______________________________________________
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