In Elementary OS Luna (or Ubuntu), how do I add an application Icon to the WingPanel (the top bar on the desktop that displays status icons like Wi-Fi connection status, Sound properties, and the Date and Time, for example?
I am using the Vala programming language.
There used to be an example on the https://wiki.gnome.org/Projects/Vala/Examples page dealing with adding a tray icon, which might solve this. I wasn't able to find the link to that, so I'll provide the source code and compile command here.
The compile command that runs this is:
valac icon_test.vala -o build_test --pkg gtk+-3.0
I'm not certain that this will add it to the panel the way that you want, but it does create traditional tray icons. Good luck. Hope this helps.