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 using this code to try to add submenus in appindicator

#!/usr/bin/env python
import gobject
import gtk
import appindicator

def clean_quit(w):
  print "in quit"
  gtk.main_quit()

    if __name__ == "__main__":
      ind = appindicator.Indicator ("example-simple-client",
                              "indicator-messages",
                              appindicator.CATEGORY_APPLICATION_STATUS)
  ind.set_status (appindicator.STATUS_ACTIVE)
  ind.set_attention_icon ("indicator-messages-new")

  # create a menu
  menu = gtk.Menu()
  listMenu=gtk.Menu()
  listItems=gtk.MenuItem("Show List")
  listItems.set_submenu(listMenu)
  inews = gtk.MenuItem("Import")
  listMenu.append(inews)
  menu.append(listItems)
  listItems.show()
  # create some
  menu_items=gtk.MenuItem("Quit")
  menu.append(menu_items)
  menu_items.connect("activate", clean_quit)
  menu_items.show()
  ind.set_menu(menu)

  gtk.main()

but it is not coming properly output

what is wrong in this code

share|improve this question

2 Answers 2

up vote 4 down vote accepted

You also forgot to call inews.show().

share|improve this answer
    
thanks that worked –  Parimal N Jun 21 '12 at 19:36

It looks like you forgot to call listMenu.show().

share|improve this answer
    
no its still the same –  Parimal N Jun 21 '12 at 19:26

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.