What's the newest way to develop gnome panel a

2019-04-07 08:44发布

问题:

Today I've switched to GNOME (from XFCE) and found some of the cool stuff missing and I would like to (try to) do them on my own. I tried to find information on how to develop Gnome applets (items you place within the panel) and most likely in Python, but it's not a hard limitation.

I found the article 'Gnome applets with Python', but it seems quite old (2004). The first thing mentioned there is bonobo (whatever it is), but Gnome page on Bonobo discourages it.

Gnome site has a page on applet development, but this one is even older (2003) and incomplete (lot of fixme write).

What is the current approach then? I wouldn't want to learn something outdated.

回答1:

Theres an article called Gnome Panel Applets in Python from 2008 on the Ubuntu forums that may help with this.

This includes defining a bonobo component. This Gnome documentation on applet development states that

Technically, applets are Bonobo controls embedded in the Gnome panel

So it looks like that is the correct way to go.



回答2:

In case anyone else comes across this question, in the forum post linked in Robert Christie's answer a user pointed out that simply using gtk.StatusIcon() is a more portable solution if you're just looking for tray icon functionality (as opposed to say a clock, or main menu applet). Additionally, if you think you need bonobo you should probably be using D-Bus anyways.