'build a gtk.TreeView to edit a RecListStore
constant, if not None, is a list of dtype names which are not editable'

def __init__(self, recliststore, constant=None):

    self.recliststore = recliststore
    gtk.TreeView.__init__(self, recliststore)
    combostrings = set(recliststore.stringd)
    if (constant is None):
        constant = []
    constant = set(constant)
    for (i, header) in enumerate(recliststore.headers):
        formatter = recliststore.formatd[header]
        coltype = recliststore.get_column_type(i)
        if (coltype == gobject.TYPE_BOOLEAN):
            renderer = gtk.CellRendererToggle()
            if (header not in constant):
                renderer.connect(u'toggled', recliststore.position_toggled, i)
                renderer.set_property(u'activatable', True)
        elif (header in combostrings):
            renderer = gtk.CellRendererCombo()
            renderer.connect(u'edited', recliststore.position_edited, i)
            (combostore, listind) = recliststore.combod[header]
            renderer.set_property(u'model', combostore)
            renderer.set_property(u'editable', True)
        else:
            renderer = gtk.CellRendererText()
            if (header not in constant):
                renderer.connect(u'edited', recliststore.position_edited, i)
                renderer.set_property(u'editable', True)
            if (formatter is not None):
                renderer.set_property(u'xalign', formatter.xalign)
        tvcol = gtk.TreeViewColumn(header)
        self.append_column(tvcol)
        tvcol.pack_start(renderer, True)
        if (coltype == gobject.TYPE_STRING):
            tvcol.add_attribute(renderer, u'text', i)
            if (header in combostrings):
                (combostore, listind) = recliststore.combod[header]
                tvcol.add_attribute(renderer, u'text-column', listind)
        elif (coltype == gobject.TYPE_BOOLEAN):
            tvcol.add_attribute(renderer, u'active', i)
        if ((formatter is not None) and (formatter.cell is not None)):
            tvcol.set_cell_data_func(renderer, formatter.cell)
    self.connect(u'button-release-event', self.on_selection_changed)
    self.get_selection().set_mode(gtk.SELECTION_BROWSE)
    self.get_selection().set_select_function(self.on_select)
