2 // GradientBackgroundView.m
5 // Created by Pierre d'Herbemont on 1/12/08.
6 // Copyright 2008 __MyCompanyName__. All rights reserved.
9 #import "GradientBackgroundView.h"
11 /**********************************************************
12 * Why not drawing something nice?
15 @implementation GradientBackgroundView
18 /* Buggy nib files... Force us to be on the back of the view hierarchy */
21 superView = [self superview];
22 [self removeFromSuperview];
23 [superView addSubview:self positioned: NSWindowBelow relativeTo:nil];
25 - (void)drawRect:(NSRect)rect
28 NSColor * topGradient = [NSColor colorWithCalibratedWhite:.12f alpha:1.0];
29 NSColor * bottomGradient = [NSColor colorWithCalibratedWhite:0.55f alpha:0.9];
30 NSGradient * gradient = [[NSGradient alloc] initWithColorsAndLocations:bottomGradient, 0.f, bottomGradient, 0.1f, topGradient, 1.f, nil];
31 [gradient drawInRect:self.bounds angle:90.0];
32 [super drawRect:rect];