Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @implementation customContentView
- - (void)drawRect:(NSRect)dirtyRect
- {
- NSRect drawRect = [self bounds];
- NSGraphicsContext *context = [NSGraphicsContext currentContext];
- //set color
- [[NSColor colorWithPatternImage:[NSImage imageNamed:@"WindowPattern.jpg"]] setFill];
- //[[NSColor blackColor] setStroke];
- //rounded rectangle
- [context saveGraphicsState];
- NSRectFill(drawRect);
- [context restoreGraphicsState];
- }
- - (void)setFrame:(NSRect)frameRect
- {
- [super setFrame:frameRect];
- self.wantsLayer = YES;
- self.layer.masksToBounds = YES;
- self.layer.cornerRadius = RADIUS;
- }
- @end
Add Comment
Please, Sign In to add comment