One Quickie


I want my window's background to be yellow (NSWindow->Hacks)
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.



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com