• 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
CGDisplayFade problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGDisplayFade problem


  • Subject: CGDisplayFade problem
  • From: Fabian <email@hidden>
  • Date: Wed, 13 Aug 2008 18:45:20 +0200

Hi all,

I have this problem where CGDisplayFade fails every fifth or so time
it is called, and I don't see why. What fails is usually fading in,
but also out from time to time. As you can see in the code below I
wait for the fade to complete in the fadeOut method, update the window
content and then wait an additional half a second before attempting to
fade in again, just to be on the safe side. In my fadeIn method I also
wait for the fade to complete before moving on. Any idea what the
problem is, or more generally what can cause this failure?

Thanks.
/ f.


- (void) aMethod
{
      [self fadeOut];
      // update window content here
      [self performSelector:@selector(fadeIn) withObject:nil afterDelay:0.5];
}

- (void) fadeOut
{

        // token = CGDisplayFadeReservationToken instance variable
	CGDisplayErr err =
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval,
										&token);

	if (err == kCGErrorSuccess) {
		CGDisplayFade (token, 0.5, kCGDisplayBlendNormal,
                kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, true);
	} else {
		NSLog(@"fade out error");
	}

}

- (void) fadeIn
{
	CGDisplayErr err = CGDisplayFade (token, 0.5, kCGDisplayBlendSolidColor,
          kCGDisplayBlendNormal, 0.0, 0.0, 0.0, true);

	if (err == kCGErrorSuccess)
		CGReleaseDisplayFadeReservation (token);
	else {
		NSLog(@"fade in error");
	}
}
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

  • Prev by Date: Re: Why won't Gmail cooperate with authentication delegate methods? (Gmail RSS feeds do.)
  • Next by Date: Re: Should I retain a variable returned from this accessor?
  • Previous by thread: Re: Why won't Gmail cooperate with authentication delegate methods? (Gmail RSS feeds do.)
  • Next by thread: How to include a .c file in a loadable bundle?
  • Index(es):
    • Date
    • Thread