Re: NSScreen Issues

2009-09-28 Thread Graham Cox
On 28/09/2009, at 4:46 PM, JECKER Frédéric wrote: What am I doing wrong ? How should I calculate my window's origin ? The window's origin is its BOTTOM left corner, not its top left. So subtract the height from the screen height to find the position you need to place its top edge at the

Re: NSScreen Issues

2009-09-28 Thread Kyle Sluder
Coordinate systems have their origins at the lower left. It seems you are not taking your window's height into account. NSWindow has the -setFrameTopLeftPoint: to help you here. The Cocoa Drawing Guide has more: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaDrawingGu

NSScreen Issues

2009-09-27 Thread JECKER Frédéric
Hi, I have a custom NSWindow that I wish to place right under the main screen menubar. In the (id)initWithContentRect: method I use the [[NSScreen mainScreen] visibleFrame] to calculate the origin of my new window. For a 1680x1050 screen resolution, the returned rect is 1676x1028 . When I set my ne