Setting the background of NSBox to a gradient programmatically without subclassing?

SelectedMenuColor is a "magic" color that is not displayed as a solid color. Many of these "magic" colors exist in the system.

SelectedMenuColor is a "magic" color that is not displayed as a solid color. Many of these "magic" colors exist in the system. I have used colorWithPatternImage: for this before.

But note that the image you use as the pattern will get tiled, so you will probably have to resize the image to the size of the box.

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.

The selectedMenuColor color is actually a pre-rendered image of a gradient, and not a gradient drawn on the fly, so there is not any way to specify an arbitrary gradient as a background color. Like Ben said, subclassing is probably the way to go.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions