Skip to content

Instantly share code, notes, and snippets.

@gpake
Created February 17, 2012 13:29
Show Gist options
  • Save gpake/1853450 to your computer and use it in GitHub Desktop.
Save gpake/1853450 to your computer and use it in GitHub Desktop.
I want my window's background to be yellow
//Why you'd want to do that, I don't know,
//but someone asked me how to turn the window background yellow.
//Since the window has a contentView NSView in it,
//this adds a category on it that draws the background with a transparent yellow.
//You also get the pinstripe effects. Just put this code anywhere.
@implementation NSView (BWYellowView)
- (void) drawRect: (NSRect) rect
{
NSColor *transparentYellow;
rect = [self bounds];
transparentYellow = [NSColor colorWithCalibratedRed: 1.0
green: 1.0
blue: 0.0
alpha: 0.333];
[transparentYellow set];
[NSBezierPath fillRect: rect];
} // rect
@end // BWYellowView
//I have no idea how you colorize the titlebar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment