On Oct 31, 2008, at 8:28 PM, David wrote:

Is NSGradient the key? Any examples of how you hook this in with a
panel or window?

NSGradient is, as you say, the key.

Remember that drawing in Cocoa takes place in a view; from that perspective, "Cocoa panel with a gradient background" isn't really a well-formed concept, because it's assuming the panel draws rather than its content view.

So just create your own custom subclass of NSView in which you override -drawRect: to render an NSGradient, and use an instance of it as your window/panel's content view. Or even just put it within your window/panel's content view, covering 100% of its area, with its springs and struts set appropriately.

  -- Chris

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to