Here is a minimal example of an AppIndicator:
#!/usr/bin/python
import gobject
import gtk
import appindicator
if __name__ == "__main__":
ind = appindicator.Indicator("example-simple-client", "gtk-execute", appindicator.CATEGORY_APPLICATION_STATUS)
ind.set_status (appindicator.STATUS_ACTIVE)
menu = gtk.Menu()
menu_items = gtk.MenuItem('Quit')
menu.append(menu_items)
menu_items.connect("activate", gtk.main_quit)
menu_items.show()
ind.set_menu(menu)
gtk.main()
Unfortunately the documentation on this is very incomplete. What I'm looking for is a way to check if the AppIndicator menu was opend by the user (e.g. the indicator icon was clicked). So is there a signal, that is emitted when the menu is opened?