• 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: Rounded NSBox/NSView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rounded NSBox/NSView?


  • Subject: Re: Rounded NSBox/NSView?
  • From: Graham Cox <email@hidden>
  • Date: Tue, 6 Oct 2009 14:30:55 +1100


On 06/10/2009, at 2:25 PM, Rob Keniger wrote:

On 06/10/2009, at 1:07 PM, Graham Cox wrote:

Views are defined by their frame/bounds rectangles. But there's nothing to stop you from setting a round-cornered clipping path at the start of your view's drawRect method to clip the view's content to a round-cornered rect. Since the view draws nothing by default, the fact that the "real" edge is a rectangle will not be apparent.

Unfortunately the OP is still going to find things difficult. A lot of Apple's standard views, such as NSTableView/NSScrollView seem to set their own custom clipping path during drawing which overrides anything you set, so it's not as straightforward as it might seem.


I agree with Kyle, it is probably a good idea to rethink the design.


Ah, I was reading the OP's question as if he wanted round corners only for his custom views, not all possible views. In that case, yes, probably a silly thing to try and attempt, and destined to fail.

--Graham


_______________________________________________

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


References: 
 >Rounded NSBox/NSView? (From: PCWiz <email@hidden>)
 >Re: Rounded NSBox/NSView? (From: Graham Cox <email@hidden>)
 >Re: Rounded NSBox/NSView? (From: Rob Keniger <email@hidden>)

  • Prev by Date: Two digit dates with NSDateFormatter
  • Next by Date: Re: How to check if a class derives from another?
  • Previous by thread: Re: Rounded NSBox/NSView?
  • Next by thread: Re: Rounded NSBox/NSView?
  • Index(es):
    • Date
    • Thread