Fwd: Chaging NSStatusItem menus.
Fwd: Chaging NSStatusItem menus.
- Subject: Fwd: Chaging NSStatusItem menus.
- From: Jeremy <email@hidden>
- Date: Tue, 26 Feb 2008 15:45:45 -0500
Here's my approach and most of my code (since it has to be "under 25
kb"):
- (void)menuWillOpen:(NSMenu *)menu
{
if([iTunes isRunning])
{
if([[[iTunes currentTrack] artist] isEqualToString:@""])
{
[one setTitle:@"Artist: N/A"];
}
else
{
[one setTitle:[NSString stringWithFormat:@"Artist: %@",[[iTunes
currentTrack] artist]]];
}
if([[[iTunes currentTrack] album] isEqualToString:@""])
{
[two setTitle:@"Album: N/A"];
[aOne setTitle:@"Album: N/A"];
}
else
{
[two setTitle:[NSString stringWithFormat:@"Album: %@",[[iTunes
currentTrack] album]]];
[aOne setTitle:[NSString stringWithFormat:@"Album: %@",[[iTunes
currentTrack] album]]];
}
if([[[iTunes currentTrack] composer] isEqualToString:@""])
{
[three setTitle:@"Composer: N/A"];
}
else
{
[three setTitle:[NSString stringWithFormat:@"Composer: %@",[[iTunes
currentTrack] composer]]];
}
if([[[iTunes currentTrack] genre] isEqualToString:@""])
{
[four setTitle:@"Genre: N/A"];
}
else
{
[four setTitle:[NSString stringWithFormat:@"Genre: %@",[[iTunes
currentTrack] genre]]];
}
[five setTitle:[NSString stringWithFormat:@"Play Count: %d times",
[[iTunes currentTrack] playedCount]]];
}
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden