wx.TaskBarIcon on Ubuntu 11.04

2019-02-18 20:00发布

There is no tray in Unity under Ubuntu 11.04.

How can I make icon appear somewhere in Unity? wx.TaskBarIcon is not appear anywhere. Thanks

3条回答
姐就是有狂的资本
2楼-- · 2019-02-18 20:43

If you're making a new application, consider using the newer libappindicator library instead – it’s Ubuntu's successor for the systray which should be compatible with GNOME 2.x at least. (I've no idea if either GNOME 3 or KDE support displaying libappindicator notifications anywhere.)

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-02-18 20:56

Best answer to give is from the official Documentation:

Under X Window System, the window manager must support either the System Tray Protocol by freedesktop.org (WMs used by modern desktop environments such as GNOME >= 2, KDE >= 3 and XFCE >= 4 all do) or the older methods used in GNOME 1.2 and KDE 1 and 2. If it doesn't, the icon will appear as a toplevel window on user's desktop.

Because not all window managers have system tray, there's no guarantee that wxTaskBarIcon will work correctly under X Window System and so the applications should use it only as an optional component of their user interface. The user should be required to explicitly enable the taskbar icon on Unix, it shouldn't be on by default.

http://docs.wxwidgets.org/stable/wx_wxtaskbaricon.html

So this is related to your windowmanager, not programming wxWidgets. wxTaskbarIcon is only reliable under wxMSW, dunno about mac. Best is to avoid it if you want real XPlatform-Applications.

查看更多
爷的心禁止访问
4楼-- · 2019-02-18 20:59

With Ubuntu Unity desktop environment (i.e. Ubuntu 11.04 or 11.10), you need to "whitelist" your application.

There are different ways to do this using the 'gsettings' application from the command line.

I had to do this to get programs like Skype showing in the system tray again, not just for my own custom apps that use wxPython.

查看更多
登录 后发表回答