Customize Drop Box (NSBox)?

Discussion in 'Mac Programming' started by Darkroom, Jul 11, 2008.

  1. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    Why isn't my NSBox setting it's fill color to green like i'm stating in my code? i've tried setting it's border width, border color, nothing seems to affect it... what am i doing wrong?

    Code:
    -(void)awakeFromNib
    	{
    	DropBox *box = [[DropBox alloc] initWithFrame:NSMakeRect(140, 100, 125, 100)];
    	[box setAutoresizingMask:NSViewMinYMargin];
    	[box setTitle:@"Drop Stuff Here"];  [COLOR="Green"]//this works, it's sets the box's title[/COLOR]
    	[box setFillColor:[NSColor greenColor]];  [COLOR="Green"]//this doesn't work[/COLOR]
    	[[self contentView] addSubview:box];
    	}
    
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Functional only when the receiver’s box type (boxType) is NSBoxCustom and its border type (borderType) is NSLineBorder.
     

Share This Page