The following test program shows the failure:
#!/usr/bin/python
from gi.repository import Gtk from gettext import gettext as _
def on_button_clicked(button, combo): print combo print combo.get_active_text()
if __name__ == "__main__":
win = Gtk.Window() win.set_size_request(500,200) box = Gtk.VBox() win.add(box)
combo = Gtk.ComboBoxText() for term in [ _(u"Please make a selection\u2026"), _("Offensive language"), _("Other") ]: combo.append_text(term) combo.set_active(0)
button = Gtk.Button("get_active_text") button.connect("clicked", on_button_clicked, combo) box.pack_start(combo, False, False, 0) box.pack_start(button, False, False, 0) win.connect("destroy", lambda w: Gtk.main_quit()) win.show_all()
Gtk.main()
*BUT* if Gtk.ComboBoxText.new() is used instead its fine.
The following test program shows the failure:
#!/usr/bin/python
from gi.repository import Gtk
from gettext import gettext as _
def on_button_ clicked( button, combo): active_ text()
print combo
print combo.get_
if __name__ == "__main__":
win = Gtk.Window() set_size_ request( 500,200)
win.
box = Gtk.VBox()
win.add(box)
combo = Gtk.ComboBoxText()
_(" Offensive language"),
_(" Other") ]:
combo. append_ text(term) set_active( 0)
for term in [ _(u"Please make a selection\u2026"),
combo.
button = Gtk.Button( "get_active_ text") connect( "clicked" , on_button_clicked, combo) pack_start( combo, False, False, 0) pack_start( button, False, False, 0) connect( "destroy" , lambda w: Gtk.main_quit())
button.
box.
box.
win.
win.show_all()
Gtk.main()
*BUT* t.new() is used instead its fine.
if Gtk.ComboBoxTex