willPositionSheet and the x coordinate
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