furkantokac
furkantokac

Reputation: 311

wxPython Changing Taskbar Icon During Runtime Windows

I have main.py and appIndicator.py files. I start appIndicator.py(which use wxPython library) from main.py as subprocess. When I have notificaion, I have to change appIndicator icon. However, I couldn't find any way to do that so when I need to change appIndicator icon, I kill subprocess from main.py, change icon file and start appIndicator as subprocess again but in Windows, when I do that, appIndicator icon is duplicated. Till the I take mouse pointer on old subprocess' icon, it stays there.

Is there any better way to change icon ?

What should I do to be able to clear old icon ?

Do you have any different suggestion ?

Thanks...

duplicated icon SS

Upvotes: 0

Views: 774

Answers (1)

Mike Driscoll
Mike Driscoll

Reputation: 33111

In your change icon event handler, try calling the current icon's RemoveIcon() method and then its Destroy() method. That should remove it from the taskbar. Then you can create the new icon that should appear there. I believe you'll have to call the new icon's SetIcon() method to make it appear in the system tray.

Upvotes: 1

Related Questions