0

I would like to make a simple applet for the Pantheon Panel on eOS Luna with Python. I can't find any documentation on any API. It's been suggested on some forum I should use the same procedure as Gnome or Unity. The applets I have tried, however (like the one on this answer), simply didn't work.

Could you guide me a little towards what I should be doing to have a simple applet icon + menu showing on the Pantheon panel?

wp78de
  • 18,207
  • 7
  • 43
  • 71
neydroydrec
  • 6,973
  • 9
  • 57
  • 89

1 Answers1

0

It seems one has to use the App Indicator module as per Ubuntu documentation. The appindicator package of PyGtk didn't work out, but the PyGi AppIndicator3 does work fine as far as I can tell.

A simple example is:

#!/usr/env/bin/ python
from gi.repository import Gtk
from gi.repository import AppIndicator3 as appindicator

def menuitem_response(w, buf):
  print buf

if __name__ == "__main__":
  ind = appindicator.Indicator.new (
                        "example-simple-client",
                        "indicator-messages",
                        appindicator.IndicatorCategory.APPLICATION_STATUS)
  ind.set_status (appindicator.IndicatorStatus.ACTIVE)
  ind.set_attention_icon ("indicator-messages-new")

  menu = Gtk.Menu()

  for i in range(3):
    buf = "Test-undermenu - %d" % i

    menu_items = Gtk.MenuItem(buf)

    menu.append(menu_items)

    menu_items.show()

  ind.set_menu(menu)

  Gtk.main()

Example drawn from here.

neydroydrec
  • 6,973
  • 9
  • 57
  • 89