Hello mailing list
I have just released one of my programs to the public and have recieved
an error message from a user I can't reproduce.
I hope someone can help with the problem regarding iteration in
a ListStore.
The Save function in the class i the buttom of this mail which inherit
from gtk.ListStore works on my pygtk 1.99.11 but fails on his 1.99.16
with an error:
> > File "/usr/local/bin/pyblink", line 104, in save
> > r=self.get_value(iter,0)
> > TypeError: iter must be a GtkTreeIter
Can any one see any logical error in the way the iteration is done.
I must admit i have done som guessing since the docs aren't that good.
Another (maybe related) problem is how to build the list.
What is the difference between:
iter = self.append ()
self.set (iter, 0, ref)
and
iter = self.append ()
self.set_value (iter, 0, ref)
I hope someone can help.
Regards Thomas
email: [EMAIL PROTECTED]
class reflistStore(gtk.ListStore) :
myFilename="unsaved.rl"
def __init__(self):
gtk.ListStore.__init__(self,gobject.TYPE_STRING)
self.data=[]
self.setFilename('unsaved.rl')
def save(self):
global allRefs, bibfile
fd=open(self.myFilename,"w")
config.set("files","last",self.myFilename)
fd.write("---bibfile=%s\n" % bibfile)
#for iter in reflist:
iter=self.get_iter_root()
while iter :
r=self.get_value(iter,0)
fd.write("%s\n" % r)
iter=self.iter_next(iter)
fd.close()
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/