<p>I want to set the background of an <code>NSBox</code> to be a gradient. In Interface Builder it is possible to set the background color of an <code>NSBox</code> to <code>selectedMenuColor</code> which is a gradient. </p>

<p><code>NSBox</code> only has a <code>setFillColor</code> method so how is Interface Builder filling it with a gradient? </p>

<p>How do I programmatically fill an <code>NSBox</code> without subclassing it? It would be trivial to subclass <code>NSBox</code> but the workings of Interface Builder suggest there may be better solution.</p>

Probably the closest you could come would be to use an NSColor created with
```
colorWithPatternImage:
```
, then create the gradient you want as an image and load that in. Ugly, but should work. I think subclassing is your best bet.