#!/usr/bin/env python

import gtk
from gtk import glade

xml = glade.XML('combo_with_items.glade')
win = xml.get_widget('window1')
win.connect('destroy', lambda *args: gtk.main_quit())

cmb = xml.get_widget('combobox1')
# ^^ Note that there is no more combo box initialization above!

# Add initial items to combo box
for i in ['a', 'b', 'c', 'd']:
    cmb.get_model().append([str(i)])

# Test _text() methods
cmb.append_text('e')    # Items: a b c d e
cmb.insert_text(2, 'X') # Items: a b X c d e
cmb.prepend_text('_')   # Items: _ a b X c d e
cmb.remove_text(1)      # Items: _ b X c d e

win.show_all()
gtk.main()

