[pygtk] Updating a progressbar inside a recursive function

listas at infinicode.org listas at infinicode.org
Tue Sep 26 05:34:23 WST 2006


Hi again,

First of all, thanks Felix for the tips! I didn't know about os.walk,
which is very helpful.

Now eveything is worked as expected (using the gobject.idle_add trick). My
only problem now is that filling a treeview with 200 elements is soooo
slow if you do it this way.

Anyway, thanks for helping everyone!
I hope i can release this app in the near future.

Thanks

-- adolfo

> Felix Rabe (public) wrote:
>> Hi Adolfo,
>>
>> You might not need to use recursive code, and generators aren't too
>> bad.  Have you looked at os.walk() already?
>
> Uno más: func_id = gobject.idle_add(func) //
> gobject.source_remove(func_id) (to interrupt)
> Junto con:
>
> def func([self]):
> 	...
> 	return True (called again) or False (last call)
>
> I hope that gives you the connection points to use os.walk with PyGTK and
> the progress bar.  (At least that is how I would approach it.)
>
> Best wishes,
> Felix
>




More information about the pygtk mailing list