• 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
Re: Applying a Drop Shadow to an NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applying a Drop Shadow to an NSView


  • Subject: Re: Applying a Drop Shadow to an NSView
  • From: George Orthwein <email@hidden>
  • Date: Wed, 16 Aug 2006 00:03:35 -0400

On Aug 15, 2006, at 11:02 PM, August Trometer wrote:

This should work for you. Keep in mind that you'll need to adjust both the shadow parameters and the area that you're filling -- as I said, you'll run up against the view's bounds and the shadow will get cut off if you're not careful.

You may just want to inset the bounds of the view to get an appropriate area to fill.


- (void)drawRect:(NSRect)rect {
    NSRect fillRect = NSInsetRect([self bounds], 10.0, 10.0);

Also, Matt Gemmell's RoundedBox example shows subclassing an NSBox to create a custom look. It doesn't use a drop shadow but could be a good starting point.
http://mattgemmell.com/source/


Hope that helps,
George




_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Applying a Drop Shadow to an NSView (From: Tom Burns <email@hidden>)
 >Re: Applying a Drop Shadow to an NSView (From: August Trometer <email@hidden>)
 >Re: Applying a Drop Shadow to an NSView (From: Tom Burns <email@hidden>)
 >Re: Applying a Drop Shadow to an NSView (From: August Trometer <email@hidden>)

  • Prev by Date: Re: Applying a Drop Shadow to an NSView
  • Next by Date: Question about NSTableView and column reordering...
  • Previous by thread: Re: Applying a Drop Shadow to an NSView
  • Next by thread: SubViews and Events
  • Index(es):
    • Date
    • Thread