1 #import "ITTableCornerView.h"
3 @interface ITTableCornerView (Private)
5 - (id)initWithFrame:(NSRect)frame cellClass:(Class)cellClass;
9 @implementation ITTableCornerView
11 - (id)initWithFrame:(NSRect)frame {
12 return [self initWithFrame:frame cellClass:[NSTableHeaderCell class]];
15 - (id)initWithFrame:(NSRect)frame cellClass:(Class)cellClass {
16 if ((self = [super initWithFrame:frame])) {
17 headerCell = [[cellClass alloc] init];
18 [self setPullsDown:YES];
23 - (void)drawRect:(NSRect)rect {
27 rect.size.height = 17;
30 [headerCell setState:([[self cell] isHighlighted] ? NSOnState : NSOffState)];
31 [headerCell drawWithFrame:rect inView:nil];
33 if ((drawImage = [self image])) {
34 BOOL oldFlipped = [drawImage isFlipped];
35 [drawImage setFlipped:YES];
36 [drawImage drawAtPoint:rect.origin fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
37 [drawImage setFlipped:oldFlipped];
41 - (void)setImage:(NSImage *)anImage {
42 [super setImage:anImage];
44 image = [anImage copy];
48 return (image ? image : [super image]);