Search code examples
macosstatusbarstatusbaritem

Animation in NSStatusItem


I'm writing a status bar application for OS X and I want to use an animated 'loading' gif as the icon when waiting to download a file.

Passing the gif in an NSImage to the setImage: method of the NSStatusItem set the status bar icon as the first frame of the image, but was not animated. I put the NSImage in an NSImageView and passed that to the setView: method but then the status item didn't show up at all.

How can I do this?


Solution

  • you might wanna use the NSProgressIndicator of spinner style and use setView to it. I'm having the same problem as you.