Reputation: 1128
Should I be "detecting" if it's retina display (not sure how would this work with mixed displays) and select the correct image for the NSStatusItem of my app? Please, give an example.
Thanks.
Upvotes: 1
Views: 771
Reputation: 3416
Example:
You have "status.png" and "[email protected]", as well as "status_negative.png" and "[email protected]" for the alternate image (on selection). Here is how you load it:
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
NSImage *statusImage = [NSImage imageNamed:@"status"];
[statusItem setImage:statusImage];
NSImage *altStatusImage = [NSImage imageNamed:@"status_negative"];
[statusItem setAlternateImage:altStatusImage];
[statusItem setHighlightMode:YES];
[statusItem setMenu:statusMenu];
Upvotes: 3