ITKit for MenuTunes
[ITKit.git] / ITTableCornerView.m
1 //
2 //  ITTableCornerView.m
3 //  
4 //
5 //  Created by Joseph Spiros on Wed Jan 22 2003.
6 //  Copyright (c) 2003 __MyCompanyName__. All rights reserved.
7 //
8
9 #import "ITTableCornerView.h"
10
11 @implementation ITTableCornerView
12
13 - (id)initWithFrame:(NSRect)frame {
14     self = [super initWithFrame:frame];
15     if (self) {
16         headerCell = [[NSTableHeaderCell alloc] init];
17     }
18     return self;
19 }
20
21 - (void)drawRect:(NSRect)rect {
22     rect.origin.y = 0;
23     rect.size.height = 17;
24     rect.size.width += 1;
25     
26     [headerCell setState: ([[self cell] isHighlighted]) ? NSOnState : NSOffState];
27     [headerCell drawWithFrame:rect inView:nil];
28     
29     if ([self image]) {
30         [[self image] drawAtPoint:rect.origin fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
31     }
32 }
33
34 - (void)dealloc {
35     [headerCell release];
36     [super dealloc];
37 }
38
39 @end