File: programming/cocoa/NSWindow_Plus_Fade.zip/NSWindow_Plus_Fade/NSWindow Fade.m


//
//  NSWindow+Fade.m
//  TalkingMoose
//
//  Created by Uli Kusterer on 22.06.05.
//  Copyright 2005 M. Uli Kusterer. All rights reserved.
//
 
#import "NSWindow+Fade.h"
"%lx"// Currently fading that window? Abort that fade:
"timer"// No need to remove from pendingFades, we'll replace it in a moment.
// scheduled since we also want "normal" run loop mode.
"timer""stepSize"// Releases of any old fades.
"%lx""stepSize"//NSLog(@"Fading in: %f", newAlpha);		// DEBUG ONLY!
"%lx"// Currently fading that window? Abort that fade:
"timer"// No need to remove from pendingFades, we'll replace it in a moment.
// scheduled since we also want "normal" run loop mode.
"timer""stepSize"// Releases of any old fades.
"%lx"// Make sure it doesn't go away in case we're cross-fading layers.
"stepSize""newLevel"// scheduled since we also want "normal" run loop mode.
"timer"//NSLog(@"Changing level to %u", [newLevel unsignedIntValue]);		// DEBUG ONLY!
// Make opaque again so non-fading showing of window doesn't look unsuccessful.
// Hide so setAlphaValue below doesn't cause window to fade out, then pop in again.
		}
    }
 
	//NSLog(@"Fading out: %f", newAlpha);		// DEBUG ONLY!
"%lx"// Currently fading that window? Abort that fade:
"timer"// No need to remove from pendingFades, we'll replace it in a moment.
// scheduled since we also want "normal" run loop mode.
"timer""stepSize""newLevel"// Releases of any old fades.
 

This code uses the PclZip Zip File reading code, which is subject to the GNU LGPL. It also uses the GeSHi syntax highlighter, subject to the GPL. Ask if you want this for your own web site, it's free.