No uses gtk.Combo esta obsoleto, mejor usa gtk.ComboBox
Código Python:
Ver originalimport gtk
text = ["ejemplo", "ejemplo2","ejemplo3","ejemplo4"]
class MyApp():
def __init__(self):
window = gtk.Window()
window.set_border_width(0)
window.set_title("ventana desplegable")
window.set_size_request(300, 150)
window.set_resizable(False)
self.combo = gtk.combo_box_entry_new_text()
for t in text:
self.combo.append_text(t)
boton = gtk.Button(stock=gtk.STOCK_OK)
boton.connect("clicked", self.onClick)
vbox = gtk.VBox()
vbox.add(self.combo)
vbox.add(boton)
window.add(vbox)
window.show_all()
window.connect("destroy", gtk.main_quit)
def onClick(self, event, data=None):
print self.combo.get_active_text()
if __name__ == "__main__":
app = MyApp()
gtk.main()