Window alpha problems
Window alpha problems
- Subject: Window alpha problems
- From: "Bobby B" <email@hidden>
- Date: Fri, 9 Jun 2006 18:20:23 -0400
Hello list;
I'm having an odd problem with setting my window's alpha values. I'm
using the following method to fade my window on a timer. If you see,
at the end of the method it calls the windows setAlphaValue:1.0 so
that the next time the window is displayed (with [myWindow
makeKeyAndOrderFront:]) it will be at it's full alpha value.
The thing is, this doesn't work for some reason. When I try to set
the window back to being in the front, it doesn't have it's alpha
value reset. I've even tried setting the window's alpha value before
showing it, and it stays at whatever value it was left at last in the
fading method.
Any clues what may be causing this?
- (void)fadeMainWindow:(id)sender
{
if ([mainWindow alphaValue] > 0.4) {
// If window is still partially opaque, reduce its opacity.
[mainWindow setAlphaValue:[mainWindow alphaValue] - 0.2];
} else {
// Otherwise, if window is at alpha value 0.4, destroy the
timer and close the window.
[fadeMainWindowTimer invalidate];
[fadeMainWindowTimer release];
fadeMainWindowTimer = nil;
[mainWindow close];
// Make the window fully opaque again for next time.
[mainWindow setAlphaValue:1.0];
}
} // end fadeMainWindow
and the timer:
fadeMainWindowTimer = [[NSTimer scheduledTimerWithTimeInterval:0.03
target:self selector:@selector(fadeMainWindow: ) userInfo:nil
repeats:YES] retain];
Any clues?
Thanks
Bobby
_______________________________________________
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