Convert NSScreen visibleFrame to screen coordinates

Send Snippet To: Save this snippet to Code Collector Pro -- view all powidl's snippets
language: Objective-C
license: Other

Code for Snippet:

@interface NSScreen (NSScreenAdditions)
// Returns visibleFrame flipped to screen coordinates
-(NSRect) flippedVisibleFrame;
@implementation NSScreen (NSScreenAdditions)
-(NSRect) flippedVisibleFrame
	NSRect visibleFrame = [self visibleFrame];
	NSRect frame        = [self frame];
	float offset = NSHeight( visibleFrame ) + (visibleFrame.origin.y - frame.origin.y);
	visibleFrame.origin.y = NSHeight( frame ) - offset;
	return( visibleFrame );
comments powered by Disqus


Link to this snippet:

Download to Code Collector

To use the direct link to your snippet on either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 806
Date Added: 2009-03-02 11:21:50
Last Modified: 0000-00-00 00:00:00

Web Analytics