[pygtk] pb with model.filter_new
Phillip Calvin
phillipc at toasterlogic.com
Sat Jul 23 10:21:06 WST 2005
The edited callback gets a parameter called iter_string. Try this code
instead:
def on_cell_edited(self, cell, path_string, new_text, model):
iter = model.get_iter_from_string(path_string)
model.set(iter, 0, new_text)
The 0 is the column number in the model.
Le Boulanger Yann wrote:
> Hi,
>
> In my app, I have a treeView, with a TreeStore as model.
> I use modle.filter_new() to select only some rows.
> But when not all the rows are shown, editing fail.
> the edited callback is called with the wrong row argument.
>
> Here is an exemple:
>
> in the treestore I have 4 rows:
> a
> b
> c
> d
>
> with the filter I only see
> b
> d
>
> if I edit the first line (b), it does as if I have edited the a line
> (because it's the first in the model). for example if I edit b to
> become B then the model contain
>
> B
> b
> c
> d
>
> in the edited callback I just have:
> model[row][0] = value
>
>
>
More information about the pygtk
mailing list