Comment 1 for bug 856429

Revision history for this message
Michael Vogt (mvo) wrote :

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.