Skip to content

Instantly share code, notes, and snippets.

@pkieltyka
Created March 25, 2009 01:25
Show Gist options
  • Save pkieltyka/84489 to your computer and use it in GitHub Desktop.
Save pkieltyka/84489 to your computer and use it in GitHub Desktop.
#import <Cocoa/Cocoa.h>
@interface HQueryView : NSView {
}
-(void) drawRoundedRect:(NSRect)rect cornerRadius:(CGFloat)radius;
@end
#import "HQueryView.h"
@implementation HQueryView
-(id) initWithFrame:(NSRect)rect
{
NSLog(@"initWithFrame at HQueryView");
if (![super initWithFrame:rect])
return nil;
return self;
}
-(void) drawRect:(NSRect)rect
{
NSLog(@"drawRect at HQueryView");
[[[NSColor blackColor] colorWithAlphaComponent:0.85] set];
[self drawRoundedRect:NSMakeRect(0, 0, rect.size.width, rect.size.height) cornerRadius:15];
}
-(void) dealloc
{
[super dealloc];
}
-(void) drawRoundedRect:(NSRect)rect cornerRadius:(CGFloat)radius
{
NSBezierPath *path = [NSBezierPath bezierPath];
[path appendBezierPathWithRoundedRect:rect xRadius:radius yRadius:radius];
[path fill];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment