Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I created an indicator with appindicator for python. Suppose I used the line build_menu_from_desktop("/my/path/myfile.desktop", "Unity") for that. How would I go about changing the created menu-items? Their labels for example?

share|improve this question
Part of the answer in: – con-f-use Jun 3 '11 at 16:11
up vote 1 down vote accepted

This question is partially answered in

Is there a detailed API documentation on the python binding for appindicator?

The answer is: loading the gtk desktop file produces a GtkMenus object somewhere which you should be able to get the gtk menu object out of by looking at it's children.

I can't find good documentation for what the build_menu_from_desktop returns, if you can't investigate the code manually to find the answer then hunt down Ted Gould who will be able to answer it. Finding the Gtk objects is the answer though.

Otherwise follow the advice for Ted in the question above, you shouldn't be using the convenience function, instead you should be building the menus manually or loading a glade file if you want the menu entries to be separated into another file. (don't forget to tie methods to their click events in that case)

share|improve this answer

Your Answer


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.