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

I have an GUI application written in PyGTK and need to read key-press/release events from application menu.

For example, when pressing shift key and click on menu item, do something else, then ordinary. gtk.Menu implement this signals and it works very well for the application, until Unity move the menu to panel - no more events from menu. I'm not willing to redesign GUI because of Unity, hope there's a better way. Thanx in advance for any hint.

share|improve this question
File a bug on It doesn't sound like an intended feature. – Jo-Erlend Schinstad Oct 10 '11 at 18:53

PyGTK was very recently discussed at the recent Ubuntu Apps Developer Week.

In summary, PyGTK has been effectively obsoleted in favour of pyGI. This is because of Unity, Gnome3 and the upcoming GTK3.

Therefore, it seems, if you want your application supported on newer platforms (not just Ubuntu), then you'll need to slightly rework your code, compiling against pyGI libraries not pyGTK.

share|improve this answer
Thank you for info, i must say that's new for me. Anyway, PyGI doesn't work on Ubuntu 10.04 and older, i'm still looking for some PyGtk workaround. It would be nice if i could prevent the menu theft.. :) – GdH May 13 '11 at 12:00
if you got a small working prototype that you can dropbox - I would be happy to have a go. – fossfreedom May 13 '11 at 12:41
Thank you, sample menu is here. When open menu and press any key, it should print key name to terminal. – GdH May 13 '11 at 14:51
I tried various stuff - but no joy. As you already know - your app works ok in ubuntu classic but not in Unity. My only suggestion is to try the ubuntu-devel mailing list – fossfreedom May 13 '11 at 19:35

Ok, i have possible workaround. It's obvious that global menu goes after gtk.MenuBar, so i've removed my menu from gtk.MenuBar and built my own simple menubar based on gtk.EventBox, gtk.Label and gtk.Menu.popup. Now i have my menu in my app window and everything works as expected. As it's a small-window app the global menu is nonsense anyway in this 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.