Possible Duplicate:
How to program a status icon that will display in Ubuntu 11.04 as well as in other distributions?
Hello, I have a small audio recording application programmed with GTK/GDK. (see picture). And I would like to add a tray-icon for it so users can control the application window and recording from it.
Adding a tray icon: I have planned to use the GtkStatusIcon class for this task. Ref: http://library.gnome.org/devel/gtk/2.11/GtkStatusIcon.html
Is GtkStatusIcon the recommended solution that also works in Ubuntu's Unity and in the GNOME 3.0 desktop? I already googled a bit and found a good example on GtkStatusIcon.
Could I also use Libindicator for this task? Ref: https://launchpad.net/libindicator
GtkStatusIcon is not supported in Unity.
If you need an icon displayed use Application Indicators instead. They are quite easy to handle but one drawback is that custom icons are not officially supported yet (see this question here), and that application indicators may not be available in other distributions.
In addition, defining custom icons as suggested here does not work in early versions of Application Indicators used in 10.04 LTS.
Therefore you may need that your program checks if Application Indicators are present, and in addition checks the version they have in order to get them running properly. If Application Indicators are not provided or if your application should also run in other distributions you can also use GtkStatusIcons. In this case you will have to program for both paths as was suggested here.
As far as I can see today GtkStatusIcons will still be supported when running classic GNOME Desktop in Ubuntu 11.04 but I don't know about GNOME3.