Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python GTK does not show menubar

I am a PHP programmer, and want to get into writing Python GUI apps under Linux.

On my Ubuntu 12.04 computer, with any version of PyGtk the MenuBar simply does not show. On my Ubuntu 10.04 computer at work, with exactly the same code, the MenuBar always shows.

I am trying to learn the up to date way of doing things, so have been using the example at the bottom of this page: http://python-gtk-3-tutorial.readthedocs.org/en/latest/menus.html

I assume one of you will know the issue straight off?

Thanks.

like image 571
Anthony Scaife Avatar asked Mar 06 '26 09:03

Anthony Scaife


2 Answers

Doh !

Ubuntu 12.04 uses Unity, and Unity shows the menu at the top of the desktop.

Doh again !

like image 82
Anthony Scaife Avatar answered Mar 07 '26 22:03

Anthony Scaife


You can find the following answer here :

In Unity you can disable the global menu for your program by setting the environment variable $UBUNTU_MENUPROXY to 0 (or anything else that is not "libappmenu.so"). So if for some reason you want to make sure that even in Unity your app shows the menu inside the app window just create a small wrapper shell script that unsets $UBUNTU_MENUPROXY and starts your program.

like image 26
Edouard Thiel Avatar answered Mar 07 '26 21:03

Edouard Thiel