Page 1 of 1

A helper/wrapper class for libappindicator

Posted: Sat Sep 12, 2015 3:37 pm
by nmset
Hello,

I just want to share a class that helps using libappindicator with wxWidgets, in case it might be useful.

Please see the attachement.

Re: A helper/wrapper class for libappindicator

Posted: Wed Sep 30, 2015 4:23 pm
by evstevemd
What is libindicator and what the class does?
Its not helpful to just dump the code :)

Re: A helper/wrapper class for libappindicator

Posted: Thu Oct 01, 2015 8:31 am
by nmset
As far as I can tell, libindicator itself is a base library on top of which many indicators have been built by Canonical, to suit their Unity desktop I suppose. An indicator is a GUI item sitting in the desktop's panel. You seem to be using Ubuntu, 'aptitude search indicator' will list a lot of those indicators.

libappindicator is one of those indicators. It makes an icon with a menu appear in the panel's 'system tray'.

This class wraps around libappindicator, expects a wxWenu and an icon, and shows the icon in the 'system tray'. The menu appears with a right-click on the icon. The icon would appear irrespective of xrender being used by the DE. For instance, it still appears in KDE4 through xrender, and in KDE5 with (K)StatusNotifier. wxTaskBar does not work with KDE5.

Re: A helper/wrapper class for libappindicator

Posted: Thu Oct 01, 2015 8:54 am
by evstevemd
nmset wrote:As far as I can tell, libindicator itself is a base library on top of which many indicators have been built by Canonical, to suit their Unity desktop I suppose. An indicator is a GUI item sitting in the desktop's panel. You seem to be using Ubuntu, 'aptitude search indicator' will list a lot of those indicators.

libappindicator is one of those indicators. It makes an icon with a menu appear in the panel's 'system tray'.

This class wraps around libappindicator, expects a wxWenu and an icon, and shows the icon in the 'system tray'. The menu appears with a right-click on the icon. The icon would appear irrespective of xrender being used by the DE. For instance, it still appears in KDE4 through xrender, and in KDE5 with (K)StatusNotifier. wxTaskBar does not work with KDE5.
So basically this is extension to wxTaskBar to work in ubuntu and KDE correct? If so, why not contribute to wx directly?
You can start a topic about it in wx-dev list
https://groups.google.com/forum/#!forum/wx-dev

Re: A helper/wrapper class for libappindicator

Posted: Thu Oct 01, 2015 7:34 pm
by nmset
If you see https://groups.google.com/d/msg/wx-dev/ ... XE-gIHsc8J, we can say that this class is Linux only and hence does have its place in a cross-platform library.

In general, wxWidgets maintainers are well aware of things posted here that can be interesting enough for them to look at. I therefore think that this class does not have such meaning for the wxWidgets library.

Re: A helper/wrapper class for libappindicator

Posted: Sat Oct 08, 2016 4:21 pm
by nmset
Hello,

After playing again with the app-indicator thing, I ended up with a much simpler code, attached in this post. It just plugs the wxMenu::m_menu object representing a GtkMenu in the indicator. The shown GTK menu has all the attributes of the source wxMenu, of which it is another representation, and changes as the source menu is modified.

Of course, it's for WXGTK builds on Linux only.

Cheers.