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.

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: askubuntu.com/q/46746/17789 –  con-f-use Jun 3 '11 at 16:11

1 Answer 1

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

 
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.