• 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: Fade out the window content
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fade out the window content


  • Subject: Re: Fade out the window content
  • From: Guy English <email@hidden>
  • Date: Wed, 9 Feb 2005 17:01:59 -0500

Render the windows content view to an NSImage.
Remove the content view and replace it with your own NSView subclass.
pass the image to your NSImage subclass and tell it to start fading.

In the NSView subclass you'll need an NSImage an NSTimer, an NSColor
to disolve to and an NSDate for the start time. You may also want a
duration as an NSTimeInterval.
When you get the start message register a timer.
When you get the timer fired message workout how long you've been
running for and set yourself as needing redisplay.

In the drawRect fill the bounds rect with the disolve to color then

alpha = 1.0 - ((now - startTime) / duration)

use this alpha to render the image (pass it in the fraction of the
drawInRect method).

When you've passed your duration stop the timer and you're done.

Guy

On Wed, 09 Feb 2005 20:56:46 +0100, Lorenzo <email@hidden> wrote:
> Hi,
> do you know a way to fade out to black the whole content of a window?
>
> Best Regards
> --
> Lorenzo
> email: email@hidden
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Fade out the window content
      • From: Lorenzo <email@hidden>
References: 
 >Fade out the window content (From: Lorenzo <email@hidden>)

  • Prev by Date: Folder Icons In Sidebar?
  • Next by Date: Re: Fade out the window content
  • Previous by thread: Fade out the window content
  • Next by thread: Re: Fade out the window content
  • Index(es):
    • Date
    • Thread