简体   繁体   中英

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...

重复的图标SS

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM