0

I am working on a Menubar app, which have a custom BackGroundView inherited from NSView, which is declared as a property named "backgroundView" in the PanelController class. I need to set violet color to this backgroundView. Can anybody tell me how do i accomplish this. Thanks in advance...

Undo
  • 25,519
  • 37
  • 106
  • 129
nbs
  • 573
  • 1
  • 6
  • 15

1 Answers1

0

In your drawRect: method you would have something like:

-(void)drawRect:(NSRect)rect
{
    [[NSColor colorWithCalibratedRed:1 green:0 blue:1 alpha:1] set]; //Not sure if this is violet, just change the color yourself

    [NSBezierPath fillRect:rect];
}
TheAmateurProgrammer
  • 9,252
  • 8
  • 52
  • 71
  • But, when i use this, the color even fills the space between menubar and the View. I want only the background view to have the colour. – nbs Apr 28 '13 at 14:52