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 currently very puzzled why something so simple fails so hard:

This is the source code for a very very simple recent chooser menu, but it fails.

My output is this:

Display name: recentchoosermenu.c
File URI: file:///home/wolf/Downloads/recentchoosermenu.c
Last application: gedit
Display name: recentchoosermenu.c
...

for every entry, it's always the first file.

I really have no idea why.

Thanks for any help,

Wolf

EDIT: Well this is embarassing, forgot to append the link: https://gist.github.com/3483363

Sorry.

share|improve this question
1  
Where is the sourcecode? Best is to provide a minimal running example. –  Timo Aug 26 '12 at 22:26
    
Sorry! Would be awesome if you could have a quick look at it! –  wolfv Aug 27 '12 at 5:44
    
I would say this is a bug somewhere (global menu perhaps?). I did some debugging and get the same results in various scenarios. I also found the PyGTK version which you probably ported to PyGI (learngtk.org/pygtk-tutorial/recentchoosermenu.html) and it has the same issue. Some more testing can be done by adding the menu to a Gtk.MenuToolButton for example to see if it really is the menuitem that messes things up. –  Timo Aug 27 '12 at 12:04

2 Answers 2

up vote 1 down vote accepted

Well, it seems that it's a bug in the global menu somewhere. When adding the Gtk.RecentChooserMenu to a Gtk.MenuToolButton or simply disabling the global menu, the problem doesn't occur.

To test, add these two lines to the very top of your code:

import os
os.environ['UBUNTU_MENUPROXY'] = '0'
share|improve this answer
    
Thanks for investigating this as well :) I will probably write my own "renderer" for the menu, as I can access all the items... –  wolfv Aug 27 '12 at 13:07

In case anybody else has problems with *generating a recent chooser menu under ubuntu", here is how I solved it for now:

http://paste.ubuntu.com/1169963/

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.