简体   繁体   中英

PyGTK menu doesn't display under Ubuntu Unity?

I have a PyGTK application, and it works fine in Gnome, but under Unity (ubuntu 10.10+) the global menu bar doesn't work - the menus are not displayed in the application window or the top bar. Is there a way to force the menu to either skip the global menu bar or display in it?

Edit: Minimal sample added.

#! /usr/bin/python

import GUI
from GUI import Window

app = GUI.Application()

window = Window()

window.show()

app.run()

I had similar problems with simple programs created using pygtk. I believe the situation is:

  • pygtk works with gtk2.x
  • Unity uses gtk3
  • pygtk does not work with gtk3
  • python-gobject is the gtk3 equivalent of pygtk

You have an extra layer of complexity since you're using pyGUI. Most likely, pyGUI uses pygtk, which will not work with GTK3 / Unity. You can either persuade the people at pyGUI to release a GTK3-compatible version, or re-write your app from scratch using python-gobject.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM