I have a custom view subclass similar to NSBox
that draws a rounded box background. The problem is that if I place a view like an NSTableView
in th
I haven't tried this with a table view but have with other controls.
In a subclass of NSTableView (or whatever view/control you want to clip)
drawRect:
appendBezierPathWithRoundedRect:xRadius:yRadius:
just remember to use the view's bounds as the size)addClip
message to add that shape to the view's clipping pathdrawRect:
If the table view has a header you may need to clip the top corners by subclassing NSTableHeaderView. And if you have scrollbars you may have to do the same thing to them except only clip certain corners. Hopefully you don't have scrollbars because I doubt that would look right. Basically you want to clip the view/control that draws that part, clipping the parent will not cause subviews to be clipped.
If you look at Apple's Welcome to Xcode window they get away with it by drawing a custom header at the top and a text block at the bottom so they don't have to round the table view itself. If you can do something like that I would.