问题
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