• 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: Window "snapping" to main screen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Window "snapping" to main screen (From: Eric Matecki <email@hidden>)
 >Re: Window "snapping" to main screen (From: Eric Matecki <email@hidden>)
 >Re: Window "snapping" to main screen (From: Quincey Morris <email@hidden>)
 >Re: Window "snapping" to main screen (From: Quincey Morris <email@hidden>)
 >Re: Window "snapping" to main screen (From: Eric Matecki <email@hidden>)

  • Prev by Date: NSTextInputClient Protocol Question
  • Next by Date: Re: dlopen error
  • Previous by thread: Re: Window "snapping" to main screen
  • Next by thread: Drawing unicode glpyhs
  • Index(es):
    • Date
    • Thread