Using MBS NSDockItemMBS to add progress bar to Dock icon?

Specifically for Christian, but anyone is welcome to provide pointers :slight_smile:

I would like to add a custom progress bar to my Application’s Dock Icon. I’ve found the NSDockIconMBS class, but can’t determine how to go about drawingmy pair of 3xWidth RoundedRects into the Dock Image and then update it.

Anyone know of an example (or a plugin, if this is outside of the NSDockIconMBS class’ design)?

What do you have problems with? It’s quite easy to make an animation in the dock icon. I make a running number of archived mails for my app.

Do you want the code?

[quote=440800:@Beatrix Willius]What do you have problems with? It’s quite easy to make an animation in the dock icon. I make a running number of archived mails for my app.

Do you want the code?[/quote]

Yes please!

NSDockTileMBS class.

But OverlayApplicationIconImage may be better in NSApplicationMBS class.
Like this:

[code] // draw a picture with a red dot on the top left

dim p as new Picture(512,512,32)

dim g as Graphics = p.Graphics
g.ForeColor = &cFF0000
g.FillRect 0,0,128,128

g = p.mask.Graphics

g.ForeColor = &cFFFFFF
g.Fillrect 0,0,512,512
g.ForeColor = &c000000
g.Filloval 0,0,128,128

Backdrop = p

// create nsimage
dim n as new NSImageMBS(p,p.mask)

// and overlay over original image
NSApplicationMBS.sharedApplication.OverlayApplicationIconImage n
[/code]

Here is my project: http://www.mothsoftware.com/downloads/DockTileChanger.zip

From the note:

When clicking on the Start Counting button a timer is started which changes the DockTile icon and counts up. With the Reset button the DockTile is reset.
As always with my code the MBS plugin is used.
Code is placed in Public Domain.

I had an additional animation working similar to an indetermined progress. But there seems to be a bug somewhere because the animation isn’t showing anymore.

Thanks Christian and Trixie!

I’ll attack those later this morning.