Created
February 17, 2012 13:29
-
-
Save gpake/1853450 to your computer and use it in GitHub Desktop.
I want my window's background to be yellow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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