python - How do I add a combobox to a message in pygtk? -
how add combo box pop-up window , return result user selects? trying adapt code other examples i've seen, gtk documentation isn't terribly clear. things along lines of following, getting fast (or, slowly, more accurate).
message = gtk.dialog(title=none, parent=none, flags=0, buttons=none) combo = gtk.combo_box_new_text() key in self.mybom.potential_keywords: combo.append_text(key) combo.set_active(0) cell = gtk.cellrenderertext() combo.pack_start(cell, true) combo.add_attribute(cell, 'text', 0) response = 0 message.add_action_widget(combo, response) response = message.run()
add_action_widget()
needs activatable widget. might try using get_content_area()
(a vbox) , packing combo box it. connect "changed" signal destroy dialog.
Comments
Post a Comment