I am trying to define an icon for a very simple status bar menu item.
My problem is that it appears always as black, or not at all, or grey-ish,
depending on what I have tried, but not as intended.

I have populated the asset catalog with icon images of all the required sizes 
that work fine in another , regular app. No luck.
I have populated the asset catalog with just one icon that I downloaded from 
here
   
https://koenig-media.raywenderlich.com/uploads/2015/03/statusbarbuttonim...@2x.png
which is supposed to work.
I still just get a black rectangle in the status bar.

(The status bar app works, btw.)

Ideally, I'd like my icon for my status bar app be in color.

Here is the code:

        let statusBar = NSStatusBar.system
        statusBarItem_ = statusBar.statusItem( withLength: 
NSStatusItem.squareLength )
//        statusBarItem_.button?.title = "AAL"
        let itemImage = NSImage(named: "AppIcon")
        itemImage?.isTemplate = true
        statusBarItem_.button?.image = itemImage

I have tried it with and without isTemplate = true.


Could anyone please give me a hint what I can try?
Thanks a lot in advance.

Best, G.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to