• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSShadow not working as expected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSShadow not working as expected
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: DeskBrowse Sources?
  • Next by Date: Re: Function from string
  • Previous by thread: Re: DeskBrowse Sources?
  • Next by thread: Re: NSShadow not working as expected
  • Index(es):
    • Date
    • Thread