• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Fwd: Chaging NSStatusItem menus.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: QCView
  • Next by Date: Re: NSString floatValue issue
  • Previous by thread: Re: Chaging NSStatusItem menus.
  • Next by thread: Best place to remove observer for NSViewBoundsDidChangeNotification
  • Index(es):
    • Date
    • Thread