[pygtk] Copying a TreeStore not working
Abhinav Lele
abhinav.lele at gmail.com
Wed Feb 7 20:47:55 WST 2007
Hi,
I am trying to copy a tree store object using python copy.copy() function
but its not copying it. What can be the problem ?
The code snippet is :
def incrUpdate(txUpdate,tv,mdlDup):
# mdl , mdlDup are treestore instances
mdl =3D tv.get_model()
# Check for tags
tagpos =3D txUpdate.find(':')
if tagpos !=3D -1 :
print "Tags not implemented."
return
print len(mdl) , len(mdlDup)
mdl =3D copy.deepcopy(mdlDup)
print type(mdl) , len(mdl)
............
OUTPUT :
25 25
/media/z/code/mpXT/listfn.py:292: GtkWarning:
gtk_tree_model_iter_n_children: assertion `GTK_IS_TREE_MODEL (tree_model)'
failed
print type(mdl) , len(mdl)
<type 'gtk.TreeStore'> 0
Why is len(mdl) zero ? Is this the wrong way to copy ?
Abhinav Lele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20070207/02a8e910/at=
tachment.htm
More information about the pygtk
mailing list