Dear Friends,
I am working in a python based application. I need an option to go
a page with Dialog >> combobox option. But I could not close the dialog box on the onchange event of combobox. My current function is:
Please advise
Thanks
Anes
I am working in a python based application. I need an option to go
a page with Dialog >> combobox option. But I could not close the dialog box on the onchange event of combobox. My current function is:
Code:
def mostrar_combobox(self, titulo, texto_etiqueta, lista):
"""
MÃ © All to show a combobox on screen and get the option chosen
"""
#print texto_etiqueta
#dialogo = gtk.Dialog(titulo, None, 0, (gtk.STOCK_OK, gtk.RESPONSE_OK, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
dialogo = gtk.Dialog(titulo, None, 0, None)
etiqueta = gtk.Label(texto_etiqueta)
etiqueta.show()
dialogo.vbox.pack_start(etiqueta)
combobox = gtk.combo_box_new_text()
for x in lista:
combobox.append_text(x)
combobox.connect('changed', self.changed_cb)
#combobox.set_active(0)
combobox.show()
dialogo.vbox.pack_start(combobox, False)
dialogo.run()
elemento_activo = combobox.get_active()
dialogo.destroy()
return elemento_activo
Thanks
Anes
Comment