Created
March 25, 2009 01:25
-
-
Save pkieltyka/84489 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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