• 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
Re: Blacking out other screens
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Blacking out other screens
      • From: "Shawn Erickson" <email@hidden>
References: 
 >Blacking out other screens (From: Andrew James <email@hidden>)

  • Prev by Date: Re: pointer address changes for no reason
  • Next by Date: Re: Strange behavior with nib loading
  • Previous by thread: Blacking out other screens
  • Next by thread: Re: Blacking out other screens
  • Index(es):
    • Date
    • Thread