How do I mount the system tray icon using Mono (Linux)?

I am using GTK # 2.12 as described here .

But when I use a PNG image with transparency, KDE doesn't want to redraw the transparent parts of the image. So, I can see the old bitmap (not the panel) on the transparent parts of the image.

I am guessing this might be a bug within GTK # itself. So I am looking for a new way to display system tray icons using mono. Perhaps some library via QSystemTrayIcon can do this. This should ideally be cross-platform. So on Windows this should also show up.

Alternatively, I can try to implement the invoke platform for the Linux version (probably a better option). But please give me an example ... I am new to Qt and platform calling in Linux.

+3


source to share


1 answer


I think you should try updating your gtk version as the version you are trying to use is very old. It looks like using Qt 3 or so. They were fine about ten years ago. It is possible that the bug was fixed a long time ago for such basic functionality.

If you want to stick with ancient software, here is a Qt shell solution though for a solution.



QYoto

from KDE is no longer supported, but it is probably the best choice of shells, so here is some sample code to do that:

using Qyoto;

class Program { 
    public static void Main(string[] args) { 
        new QApplication(args); 
        var tray = new QSystemTrayIcon(this);
        tray.SetIcon(new QIcon(":/gui/logo.png"));
        ...
        tray.Show();
        QApplication.Exec(); 
  }   
} 

      

+1


source







All Articles