Making MenuTunes use the ITKit, for ITStatusItem. There are a few notes:
authorMatthew Judy <mjudy@ithinksw.com>
Thu, 12 Dec 2002 09:09:36 +0000 (09:09 +0000)
committerMatthew Judy <mjudy@ithinksw.com>
Thu, 12 Dec 2002 09:09:36 +0000 (09:09 +0000)
1-) In order to build MenuTunes from this point forward, you
will need to check out the ITKit and build it.
2-) The ITKit project folder will need to be in the same folder as
MenuTunes.  For example, I have both ITKit and MenuTunes inside ~/Projects.

So, check MenuTunes out wherever you keep your projects, build it, and
all should go well.  The MenuTunes project will find ITKit, link against
it, and copy it inside the MenuTunes app package.

If you have any questions, ask me IMMEDIATELY.  Thanks!

MenuTunes.h
MenuTunes.m

index c7dc4fd..da28d11 100755 (executable)
 
 #import <Cocoa/Cocoa.h>
 #import <Carbon/Carbon.h>
+#import <ITKit/ITKit.h>
 
 //@class MenuTunesView;
 @class PreferencesController, StatusWindowController;
 
 @interface MenuTunes : NSObject
 {
-    NSStatusItem *statusItem;
+    ITStatusItem *statusItem;
     NSMenu *menu;
     ComponentInstance asComponent;
     
index f4a66cd..7df098f 100755 (executable)
@@ -57,16 +57,15 @@ Things to do:
         [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(iTunesLaunched:) name:NSWorkspaceDidLaunchApplicationNotification object:nil];
         refreshTimer = nil;
     }
+
+    statusItem = [[ITStatusItem alloc] initWithStatusBar:[NSStatusBar systemStatusBar]
+                                              withLength:NSVariableStatusItemLength];
     
-    statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
-    [[[statusItem _button] cell] setType:NSNullCellType];
     [statusItem setImage:[NSImage imageNamed:@"menu"]];
-    [[statusItem _button] setAlternateImage:[NSImage imageNamed:@"selected_image"]];
-    [statusItem setHighlightMode:YES];
+    [statusItem setAlternateImage:[NSImage imageNamed:@"selected_image"]];
     [statusItem setMenu:menu];
     // Below line of code is for creating builds for Beta Testers
     // [statusItem setToolTip:@"This Nontransferable Beta (Built on __DATE__) of iThink Software's MenuTunes is Registered to: Beta Tester (betatester@somedomain.com)."];
-    [statusItem retain];
 }
 
 
@@ -97,23 +96,19 @@ Things to do:
                 nil] forKey:@"menu"];
     }
     
-    if (![defaults objectForKey:@"showName"])
-    {
+    if (![defaults objectForKey:@"showName"]) {
         [defaults setBool:YES forKey:@"showName"];
     }
     
-    if (![defaults objectForKey:@"showArtist"])
-    {
+    if (![defaults objectForKey:@"showArtist"]) {
         [defaults setBool:YES forKey:@"showArtist"];
     }
     
-    if (![defaults objectForKey:@"showAlbum"])
-    {
+    if (![defaults objectForKey:@"showAlbum"]) {
         [defaults setBool:NO forKey:@"showAlbum"];
     }
     
-    if (![defaults objectForKey:@"showTime"])
-    {
+    if (![defaults objectForKey:@"showTime"]) {
         [defaults setBool:NO forKey:@"showTime"];
     }
 }
@@ -215,9 +210,11 @@ Things to do:
     if (upcomingSongsItem) {
         [self rebuildUpcomingSongsMenu];
     }
+    
     if (playlistItem) {
         [self rebuildPlaylistMenu];
     }
+    
     if (eqItem) {
         [self rebuildEQPresetsMenu];
     }