NSShadow not working as expected
NSShadow not working as expected
- Subject: NSShadow not working as expected
- From: Ken Tozier <email@hidden>
- Date: Sat, 30 Jun 2007 16:10:43 -0400
Hi
I'm trying to apply an NSShadow inside the drawRect method of a
custom view and can't get it to appear. Here's the code
- (void) drawRect:(NSRect) inRect
{
NSShadow *shadow = [[[NSShadow alloc] init] autorelease];
[shadow setShadowOffset: NSMakeSize(2, -2)];
[shadow setShadowBlurRadius: 3];
[shadow set];
[backgroundColor set];
NSRectFillUsingOperation(inRect, NSCompositeSourceOver);
if (selected)
{
[[NSColor keyboardFocusIndicatorColor] set];
NSFrameRectWithWidth(inRect, 2);
}
}
The strange thing is, if selected = YES, the shadow draws inside the
focus ring but if selected = NO, no shadow is drawn at all.
I want the shadow to appear outside the rectangle specified by
"inRect." Anyone see what I'm doing wrong?
TIA
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden