• 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
willPositionSheet and the x coordinate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

willPositionSheet and the x coordinate


  • Subject: willPositionSheet and the x coordinate
  • From: Nick Zitzmann <email@hidden>
  • Date: Wed, 17 May 2006 16:16:45 -0600

I already searched the archives and didn't see anything about this. According to the documentation on the NSWindow delegate method - window:willPositionSheet:usingRect:

"They [the point coordinates] indicate where the top-left edge of the sheet is attached to the window. The origin is expressed in window coordinates; the default origin.y value is the height of the content view and the default origin.x value is zero."

I noticed that if I pass in 0 for the origin's x position, the sheet appears in the middle of the window. That's contrary to how the method is documented, which suggests that 0 points to the left edge of the window. Now I have a frame and I want the sheet to pop out centered under that frame, so I set the y coordinates to match and that works, but how am I supposed to calculate the x coordinate if zero isn't the left edge? Has anyone ever ever done this before, and if so, then how did you calculate the x position?

Nick Zitzmann
<http://www.chronosnet.com/>


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: How to create "pressed" effect on custom rounded buttons (like Safari bookmark)
  • Next by Date: Re: what's an easy way to use NSBrowser?
  • Previous by thread: Re: NSApplication Terminate:self <-- doesn't trigger dealloc method.
  • Next by thread: taking control of the screen and "locking" onto one window
  • Index(es):
    • Date
    • Thread