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?

| improve this question | | | | |

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)

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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