A helper/wrapper class for libappindicator

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Post Reply
nmset
Knows some wx things
Knows some wx things
Posts: 46
Joined: Fri Nov 26, 2010 4:48 pm

A helper/wrapper class for libappindicator

Post 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.
Attachments
appindic-1.tar.gz
(20.95 KiB) Downloaded 370 times
appindic-0.tar.gz
(20.7 KiB) Downloaded 322 times
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: A helper/wrapper class for libappindicator

Post by evstevemd »

What is libindicator and what the class does?
Its not helpful to just dump the code :)
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
nmset
Knows some wx things
Knows some wx things
Posts: 46
Joined: Fri Nov 26, 2010 4:48 pm

Re: A helper/wrapper class for libappindicator

Post 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.
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: A helper/wrapper class for libappindicator

Post 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
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
nmset
Knows some wx things
Knows some wx things
Posts: 46
Joined: Fri Nov 26, 2010 4:48 pm

Re: A helper/wrapper class for libappindicator

Post 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.
nmset
Knows some wx things
Knows some wx things
Posts: 46
Joined: Fri Nov 26, 2010 4:48 pm

Re: A helper/wrapper class for libappindicator

Post 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.
Attachments
appindic-2.tar.gz
(21.85 KiB) Downloaded 343 times
Post Reply