views:

27

answers:

1

I have an NSWindow, and I'm using this code to add a bottom-metal-bar at the bottom.

[MyWindow setContentBorderThickness:40.0 forEdge:NSMinYEdge];

That works fine. But, once I use this:

[MyWindow setBackgroundColor: [NSColor redColor]];

The red covers the bar at the bottom. The bar shows correctly without the background color.

+2  A: 

Yes, it would appear that changing the background-color of an NSWindow negates its bottom border. In order to achieve both effects, you can do one of two things:

  1. In Interface Builder, move all your interface elements to a subclass of NSView that draws its background and add the view to your window.
  2. Create an NSView that emulates the bottom border of your window and set the window's background color.

Personally, I would go for the first option, because it requires less work (trying to emulate a bottom border will be difficult, even with NSGradient) , but both are a possibility.

itaiferber
Thanks for the answer, but what I attempted to do instead was make an image that was the background color I wanted, and use a bit of resizing in IB to make it the background color of the window.
alexy13
You can do that with either option, drawing the image as the background to the view.
itaiferber