What object to place for manually drawing gradients on?

Discussion in 'Mac Programming' started by MythicFrost, Jun 17, 2010.

  1. MythicFrost macrumors 68040

    MythicFrost

    Joined:
    Mar 11, 2009
    Location:
    Australia
    #1
    Hi,

    I'm wondering what object do I place so that I can manually (from code) draw a gradient over it. I had a look at an Image Well in IB, and searched for NSImageView in the documentation and it didn't seem to have any events that I could use to draw on it, I just want a static control I can draw on the background of.

    In fact, I need to be able to do the same thing on buttons, and windows as well. Is this possible?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Same as any other custom drawing: subclass the class (or NSView) and override drawRect:
     
  3. MorphingDragon macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #3

Share This Page