'Replace the value of a row or a cell in this table with
``val``.
If ``index`` is an integer, then ``val`` should be a row value
(i.e., a tuple of cell values, one for each column).  In this
case, the values of the ``index``th row of the table will be
replaced with the values in ``val``.
If ``index`` is a tuple of integers, ``(i,j)``, then replace the
value of the cell in the ``i``th row and ``j``th column with
``val``.'

def __setitem__(self, index, val):

    if isinstance(index, slice):
        raise ValueError('Slicing    not    supported')
    elif (isinstance(index, tuple) and (len(index) == 2)):
        (i, j) = (index[0], self.column_index(index[1]))
        config_cookie = self._save_config_info([i])
        self._rows[i][j] = val
        if (self._reprfunc is not None):
            val = self._reprfunc(i, j, val)
        self._mlb.listboxes[j].insert(i, val)
        self._mlb.listboxes[j].delete((i + 1))
        self._restore_config_info(config_cookie)
    else:
        config_cookie = self._save_config_info([index])
        self._checkrow(val)
        self._rows[index] = list(val)
        if (self._reprfunc is not None):
            val = [self._reprfunc(index, j, v) for (j, v) in enumerate(val)]
        self._mlb.insert(index, val)
        self._mlb.delete((index + 1))
        self._restore_config_info(config_cookie)
