Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Oats

macrumors regular
Original poster
Jan 8, 2003
194
1
New York
I'd like to get a window that has a semi-transparent blurred background, just like what the Terminal can do. See this video, about 30 sec in, to see what I mean: http://www.youtube.com/watch?v=zo8KPRY6-Mk
mac-os-x-lion-terminal.jpg



I've been googling for an hour, and can't get anything to work. I believe I need to somehow create a core animation layer and add a background filter, but I've been unsuccessful so far... I just see the gray background of my window. Here's the code I've got so far:

Code:
    //  Get the content view -- everything but the titlebar.
    NSView *theView = [[self window] contentView];
    [theView setAlphaValue:0.5];

    // Create core animation layer, with filter
    CALayer *backgroundLayer = [CALayer layer];
    [theView setWantsLayer:YES];
    [theView setLayer:backgroundLayer]; 
    CIFilter *blurFilter = [CIFilter filterWithName:@"CIGaussianBlur"];
    [blurFilter setDefaults];
    [theView layer].backgroundFilters = [NSArray arrayWithObject:blurFilter];  
    [[theView layer] setBackgroundFilters:[NSArray arrayWithObject:blurFilter]];

Any tips or examples to do what I'm trying to do?
Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.