On Fri, 25 Nov 2005 15:58:59 -0800
John Finlay <[EMAIL PROTECTED]> wrote:

> >I changed the code that way and now it works with the first
> >"on_iter_nth_child" I wrote. I still have a little doubt, the
> >references says that the methode on_get_iter should raise a
> >ValueError exception if the path is not valid. Should I add a "raise
> >ValueError" before the "return None" line?
> You have confused on_get_iter() with TreeModel.get_iter() - two 
> different things.

Yes ... but isn't "on_get_iter" the method wich is called when
"get_iter" is used with my custom_list?
So if "get_iter" have to raise a ValueError with invalid paths I should
raise this ValueError in on_get_iter ... I think.

> >>>   def on_get_path(self, rowref):
> >>>       return tuple(rowref)
> >>>      
> >>>
> >
> >I also modified this method in that way:
> >   
> >       def on_get_path(self, rowref):
> >           return tuple([rowref])
> >
> >cause rowref should be a list index, but "tuple" requires an iterable
> >item.
> >  
> >
> 
> I suppose you could just return rowref since it's just a list index.

Hmm, in this custom list rowref is and index and path is a tuple with
only one element equal to the index (cause this is not a tree).
But maybe I could have a path wich is an index, i.e. rowref=path ...

> >Do you think the code is correct now?
> Until you find the next bug. :-)

LOL, of course :-D

-- 
 
 |\ |       |HomePage   : http://nem01.altervista.org
 | \|emesis |XPN (my nr): http://xpn.altervista.org
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to