1

I'm creating an app that must run on Tiger and I need to draw a gradient onto a NSView. Unfortunately, NSGradient is only available on Leopard and above. Google wasn't my friend at all. How do I draw a gradient to a NSView on Mac OS X 10.4?

Thanks!

Paul R
  • 208,748
  • 37
  • 389
  • 560
Fernando Valente
  • 1,096
  • 1
  • 8
  • 30

2 Answers2

2

A lot of developers used CTGradient before Apple introduced NSGradient. It's a wrapper around the CGShading C API.

Rob Keniger
  • 45,830
  • 6
  • 101
  • 134
1

You will need to use a CGShading object to draw the gradient, and write the interpolation function for it yourself (an example is given in the Quartz 2D Programming Guide).

一二三
  • 21,059
  • 11
  • 65
  • 74