Edit: It turns out that this behavior is even simpler if you are targeting OS X Lion or later β just call [sheet setOpaque:NO]
enough to include rounded corners.
This behavior is fairly easy to reproduce. Initialize your sheet as a transparent borderless window:
self.sheet = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 300, 300) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered | NSTitledWindowMask defer:YES]; [self.sheet setOpaque:NO]; [self.sheet setBackgroundColor:[NSColor clearColor]];
Add custom view as slave mode:
[[self.sheet contentView] addSubview:[[IFWindowView alloc] initWithFrame:[[self.sheet contentView] frame]]];
This custom view should make its drawing as follows:
#define RADIUS 5.0 NSBezierPath *bezierPath = [NSBezierPath bezierPathWithRoundedRect:NSMakeRect(self.bounds.origin.x, self.bounds.origin.y + RADIUS, self.bounds.size.width, self.bounds.size.height) xRadius:RADIUS yRadius:RADIUS]; [[NSColor windowBackgroundColor] set];
Here is a sample code to demonstrate this in action: http://d.pr/l9DB
source share