• 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
Forcing ordered-out-window to adjust position
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Forcing ordered-out-window to adjust position


  • Subject: Forcing ordered-out-window to adjust position
  • From: Philip White <email@hidden>
  • Date: Sat, 15 May 2010 10:39:53 -0500

Hello,
   I was hoping someone could offer me some suggestions: Here is what I'm trying to do.
I have a window that I create with the NSBorderlessWindowMask flag set. Since windows with this flag set don't really adopt any of the cocoa movement, sizing, or constraining behavior, I've been forced to reimplement this myself. The only real problem has been the constraining behavior (keeping titlebars on screen, not behind the menubar, etc). I've developed a decent approximation of Cocoa's behavior but I keep on finding shortcomings in this behavior when there a multiple screens arranged in unusual ways.

So I came up with what I though was a bright idea. I'd keep a dummy window, a normal titled, bordered window, and use it to test window positions and shapes for validity. Of course that window has to be ordered-out so the user is unaware of it. So the problem is, while ordered-out windows are subject to the same constraints as ordered-in windows, those constraints seemed to be applied lazily. So if you use NSWindow's setFrameOrigin: to set an ordered-in window's position to something invalid, that position will be corrected immediately. But for an ordered-out window it will be corrected sometime later in the run loop. I've tried various schemes for deferring checking of the dummy window's position (notifications using NSPostWhenIdle, etc.) but I can't get consistent behavior.

Is there a way force a window to immediately do its constraint checks? I've poked around with FScript trying to figure something out but no luck yet.

Many thanks in advance,
   Philip White
_______________________________________________

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

  • Follow-Ups:
    • Re: Forcing ordered-out-window to adjust position
      • From: Jesper Storm Bache <email@hidden>
    • Re: Forcing ordered-out-window to adjust position
      • From: Scott Ribe <email@hidden>
  • Prev by Date: Re: NSTreeController and remove:
  • Next by Date: Sorting the NSSet of a NSManagedObject's attribute
  • Previous by thread: Re: Posix error 24
  • Next by thread: Re: Forcing ordered-out-window to adjust position
  • Index(es):
    • Date
    • Thread