osx - Changing alpha of window background, not the whole window -
so have quick question have method below sets alpha value of window depending on value slider, content of window becomes translucent , disappears window.
is there way change alpha value of window , not content view inside it?
- (ibaction)changetransparency:(id)sender { // set window's alpha value. cause views in window redraw. [self.window setalphavalue:[sender floatvalue]];}
thanks, sami.
apple's docs gives way this. key set window's backgroundcolor
's alpha desired value. must make sure set window's opaque
property no
(which yes
default.)
e.x.
// @ point in code... [window setopaque:no]; // in changetransparency: method... nscolor *backgroundcolor = [window backgroundcolor]; backgroundcolor = [backgroundcolor colorwithalphacomponent:[sender floatvalue]]; [window setbackgroundcolor:backgroundcolor];
Comments
Post a Comment