Re: Blacking out other screens
Re: Blacking out other screens
- Subject: Re: Blacking out other screens
- From: Roland Torres <email@hidden>
- Date: Mon, 9 Apr 2007 10:55:18 -0700
On Apr 9, 2007, at 1:45 AM, Andrew James wrote:
What is the best method to black out any other screens? i had the
idea to draw a big window on the secondary screen but what about
the other 2 or how ever many someone may have.
It's as simple as this:
int i;
NSArray *screenArray=[NSScreen screens];
int count=[screenArray count];
for (i=0;i<count;i++) {
NSRect frame=[[screenArray objectAtIndex:i] frame];
NSWindow *aWindow=[[NSWindow alloc] initWithContentRect:
NSMakeRect(0.0,0.0,frame.size.width,frame.size.height)
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO
screen:[screenArray objectAtIndex:i]];
[aWindow setBackgroundColor:[NSColor blackColor]];
[aWindow orderFront:nil];
}
Roland
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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