824683bee69c702ae93ecca760ab433eba91d9d4
[MenuTunes.git] / MenuTunesView.m
1 //
2 //  MenuTunesView.m
3 //  MenuTunes
4 //
5 //  Created by Kent Sutherland on Tue Nov 19 2002.
6 //  Copyright (c) 2002 Kent Sutherland. All rights reserved.
7 //
8
9 #import "MenuTunesView.h"
10
11
12 @implementation MenuTunesView
13
14 - (id)initWithFrame:(NSRect)frame
15 {
16     if ( (self = [super initWithFrame:frame]) )
17     {
18         image = [NSImage imageNamed:@"menu"];
19         altImage = [NSImage imageNamed:@"selected_image"];
20         curImage = image;
21     }
22     return self;
23 }
24
25 - (void)drawRect:(NSRect)rect
26 {
27     [curImage compositeToPoint:NSMakePoint(0, 0) operation:NSCompositeSourceOver];
28 }
29
30 - (void)mouseDown:(NSEvent *)event
31 {
32     curImage = altImage;
33     [self setNeedsDisplay:YES];
34     [super mouseDown:event];
35 }
36
37 - (void)mouseUp:(NSEvent *)event
38 {
39     curImage = image;
40     [self setNeedsDisplay:YES];
41     [super mouseUp:event];
42 }
43
44 @end