Largo: The ITKit is not l33t. I will make it l33t.
[ITKit.git] / ITStatusItem.m
1 #import "ITStatusItem.h"
2
3 /*************************************************************************/
4 #pragma mark -
5 #pragma mark EVIL HACKERY
6 /*************************************************************************/
7
8 // This stuff is actually implemented by the AppKit.
9 // We declare it here to cancel out warnings.
10
11 @interface NSStatusBarButton : NSButton
12 @end
13
14 @interface NSStatusItem (HACKHACKHACKHACK)
15 - (id) _initInStatusBar:(NSStatusBar*)statusBar
16              withLength:(float)length
17            withPriority:(int)priority;
18 - (NSStatusBarButton*) _button;
19 @end
20
21
22 @implementation ITStatusItem
23
24 /*************************************************************************/
25 #pragma mark -
26 #pragma mark INITIALIZATION METHODS
27 /*************************************************************************/
28
29 - (id)initWithStatusBar:(NSStatusBar*)statusBar withLength:(float)length
30 {
31     if ( ( self = [super _initInStatusBar:statusBar
32                                withLength:length
33                              withPriority:1000] ) ) {
34                              
35         //Eliminate the fucking shadow...
36         [[[self _button] cell] setType:NSNullCellType];
37         
38         //Be something other than a dumbshit about highlighting...
39         [self setHighlightMode:YES];
40     }
41     return self;
42 }
43
44
45 /*************************************************************************/
46 #pragma mark -
47 #pragma mark ACCESSOR METHODS
48 /*************************************************************************/
49
50 - (NSImage*) alternateImage {
51     return [[self _button] alternateImage];
52 }
53
54 - (void) setAlternateImage:(NSImage*)image {
55     [[self _button] setAlternateImage:image];
56 }
57
58 @end