GTK# StatusIcon Icon not display

谁说胖子不能爱 提交于 2020-01-06 08:36:28

问题


I tried to adding icon in Windows Tray using below code in GTK# application.( i am using XAMARIN STUDIO to develop GTK# application)

enter code here
Statusbar status = new Statusbar ();
trayIcon = new StatusIcon();                
trayIcon.Pixbuf = new Gdk.Pixbuf ("TrayIcon.ico");
trayIcon.IconName="Tray Icon Name";
trayIcon.Visible = true;               
trayIcon.PopupMenu += trayIcon_PopupMenu;
trayIcon.Tooltip = "Tray Icon Tooltip";

Icon added and contextmenu also added but icon "TrayIcon.ico" not display on windows.

And same application i tried on MAC OSX but icon not added at MAC OSX.


回答1:


I solved this by removing below line from code. trayIcon.IconName="Tray Icon Name";

I am not sure but i assume that IconName overwrite (trayIcon.Pixbuf) IconImage.



来源:https://stackoverflow.com/questions/20858034/gtk-statusicon-icon-not-display

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!