A mi si me funciona bien.
Código Python:
Ver originalimport gtk
class PyApp(gtk.Window):
def __init__(self):
super(PyApp, self).__init__()
self.set_title("Simple menu")
self.set_size_request(250, 200)
self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(6400, 6400, 6440))
self.set_position(gtk.WIN_POS_CENTER)
mb = gtk.MenuBar()
filemenu = gtk.Menu()
filem = gtk.MenuItem("File")
filem.set_submenu(filemenu)
save = gtk.MenuItem("Save")
exit = gtk.MenuItem("Exit")
exit.connect("activate", gtk.main_quit)
save.connect("activate", self.on_save)
gtk.Widget.set_sensitive(save, False)
filemenu.append(save)
filemenu.append(exit)
mb.append(filem)
vbox = gtk.VBox(False, 2)
vbox.pack_start(mb, False, False, 0)
self.add(vbox)
self.connect("destroy", gtk.main_quit)
self.show_all()
def on_save(self, event=None):
print "Click save"
PyApp()
gtk.main()
Fuente del código base:
http://zetcode.com/gui/pygtk/menus/