Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to run a program that makes use of application indicators - but it isn't working. This could be because I am missing a package (I didn't use the Desktop Installer CD to install Ubuntu - I installed the core packages and then added others as needed). The application in question is written in Python.

Here is a simple Python script to check and see if app. indicators are working:

import appindicator
import gtk

appindicator.Indicator("test", "monitor", appindicator.CATEGORY_APPLICATION_STATUS)
gtk.main()
share|improve this question
1  
Said script doesn't seem to work for me. –  jrg Nov 1 '11 at 18:29
    
@jrg: Do you have python-appindicator and python-gtk2 installed? –  Nathan Osman Nov 1 '11 at 18:30
    
Yes, I do - both python-appindicator and python-gtk2 are the newest versions. –  jrg Nov 1 '11 at 18:32
    
Does the one here work? - jonobacon.org/2009/12/17/application-indicators-in-python –  jrg Nov 1 '11 at 18:35
1  
Or you could post an answer saying he did it wrong and get credits for it! Decisions, decisions... ^^ –  Bruno Pereira Nov 1 '11 at 18:47

1 Answer 1

up vote 2 down vote accepted

I clicked through the commented one:

http://www.jonobacon.org/2009/12/17/application-indicators-in-python/

and found the original wiki:

https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators#Python_version

It appears that adding the menu (even an empty one with "ind.set_menu(gtk.Menu())") results in a status indicator appearing. Is that the desired result?

import appindicator
import gtk
ind = appindicator.Indicator("test", "monitor", appindicator.CATEGORY_APPLICATION_STATUS)
ind.set_status(appindicator.STATUS_ACTIVE)
ind.set_attention_icon("indicator-messages-new")
menu = gtk.Menu()
ind.set_menu(gtk.Menu())
gtk.main()
share|improve this answer
    
Yes, and adding a menu does indeed cause the indicator to work. Thank you for the answer. –  Nathan Osman Nov 2 '11 at 2:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.