Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSStatusItem and white highlighted image

Tags:

cocoa

I create Status item with a black and transparent PNG. I see that many applications change color icon to white when highlighted (with the default blue background) i wondering weather this process is automatic or i have to call setAlternateImage to change it manually. This case how can I automatically produce the white copy of my image ? is there some tricks or best way to accomplish that ?

like image 632
MatterGoal Avatar asked Aug 24 '11 19:08

MatterGoal


1 Answers

If you are using imageNamed:, you can simply append "Template" to your file name to get this behavior (e.g. "StatusItemTemplate.png"). Otherwise use [myImage setTemplate:YES].

like image 60
omz Avatar answered Sep 29 '22 20:09

omz