• 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: screensaver background color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: screensaver background color


  • Subject: Re: screensaver background color
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Thu, 8 Jul 2004 19:30:47 -0700

Hello...

If suggestions that are (or aren't) being made are not helping you to solve your problem, you might want to consider posting more information (complete code or pseudo code from the methods involved!) instead of just repeating the same question. Please also keep in mind that sometimes it may take more than just a day to get an answer, since not everybody has time to respond to each email that is posted to the list, and it might just be that the people who can answer your question have just not had a chance to do so yet.

In this particular case, part of the reason why you probably aren't getting much help is because the answer that Andreas posted is correct, and there is something else fundamentally wrong in your code.


My guess (since we don't have the full code for your drawRect: method) is that the problem is that you are invoking [super drawRect:rect] at the end of your implementation. The default ScreenSaverView implementation of the of the drawRect: method fills the provided rect with a black background, which would create the result that you are observing.

So, your drawRect: method should look something like this, if you want a blue background:

- (void)drawRect:(NSRect)someRect
{
[[NSColor blueColor] set];
NSRectFill(someRect);

/* ... the rest of your drawing unless you are using the animateOneFrame method to draw... */
}


Also, if you want to make the screensaver partially transparent, you should probably check to make sure it is not running in preview mode before changing the alpha value for the window.

if (![self isPreview]) {[[self window] setAlphaValue:0.7];}

Otherwise you will make the window of the System Preferences application partially transparent as well, which might be somewhat problematic.


Hope that helps,

Louis


I haven't received much response at all to this other then a few
suggestions from Andreas. I have not been able to get this what I want
working at all. Can someone please tell me how I can change the
default black background of a screen saver to another color.

Any help at all would be appreciated.

Thank you,

-Rhon Fitzwater
On Jul 8, 2004, at 3:23 PM, Rhon Fitzwater wrote:

Adding the code below to my drawRect: method does not work. Does
anyone else have any other suggestions?

> [[self window] setAlphaValue:0.7];
[[NSColor blueColor] set];
NSRectFillUsingOperation(rect, NSCompositeCopy);

My window is still semi-transparent and black instead of blue.

Thanks,

-Rhon
On Jul 8, 2004, at 9:24 AM, Rhon Fitzwater wrote:

I am still not having any luck. Does anyone have any suggestions?

Thanks,

-Rhon
On Jul 7, 2004, at 6:50 PM, Rhon Fitzwater wrote:

how can I change the default screensaver background color (black) to
something else, say blue? I tried doing this:
[self setBackgroundColor:[NSColor blueColor]];

but get a warning saying the screensaver view may not respond to that
line of code, which it doesnt. Is there something that I am missing?

Thanks,

-Rhon
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >screensaver background (From: Rhon Fitzwater <email@hidden>)
 >Re: screensaver background color (From: Rhon Fitzwater <email@hidden>)
 >Re: screensaver background color (From: Rhon Fitzwater <email@hidden>)
 >Re: screensaver background color (From: Rhon Fitzwater <email@hidden>)

  • Prev by Date: Re: Test dylib dependencies
  • Next by Date: 'No Selection' placeholder appearing in text fields bound to keys of NSArrayController
  • Previous by thread: Re: screensaver background color
  • Next by thread: Basic class relationship question
  • Index(es):
    • Date
    • Thread