def create_liststore(self, combobox, items, selected_index = 0, has_empty = True, empty_label = "Select One"):
        liststore = combobox.get_model()
        if not liststore:
            liststore = gtk.ListStore(str, str)
            cell = gtk.CellRendererText()
            combobox.pack_start(cell)
            combobox.add_attribute(cell, 'text', 0)
            combobox.add_attribute(cell, 'text', 0)

        else:
            liststore.clear()

        if has_empty:
            liststore.append([str(empty_label), None])
        for p in items:
            liststore.append([items[p], p]) #value, key

        combobox.set_model(liststore)
        combobox.set_active(selected_index)
Create a liststore filled with items, connect it to a combobox and activate the first index
dataset/ETHPy150Open lionheart/TimeTracker-Linux/libs/UI.py/uiCreator.create_liststore