我正在使用 WxPython(phoenix 新版本)在程序运行时在托盘栏上显示一个图标,但我会通过一些事件来更改所使用的图标。
我发现了这个很好的例子来开始工作:快速而简单:trayicon with python?
但它没有循环图标的示例。
在导入之后,它有这一行:
TRAY_ICON = 'icon.png'
Run Code Online (Sandbox Code Playgroud)
我尝试将其用作变量,并将以下行添加到事件中(它有一些模拟事件,例如右键单击hello world
TRAY_ICON = 'icon2.png'
Run Code Online (Sandbox Code Playgroud)
但没有成功=//
I only found examples in c, and one in python but using a very complex win32 alternative that I can't figure out