On 7/25/05, Gustavo J. A. M. Carneiro <[EMAIL PROTECTED]> wrote:
>   In open_cb, schedule a _single_ read of block size; In read_cb, read
> what there is to read, then schedule another read using the same
> callback, until you've read the entire file.

Awesome! That worked.

------------------------------------------------------------

# Insert Text into a GTK Buffer
        
def read_cb(handle, buffer, exc_type, bytes_requested):
        
        if buffer != "":
        
                txt_buffer.insert_at_cursor(buffer)
                handle.read(opt_size, read_cb)
                
        else:
                
                handle.close(close_cb)
        
# Try to read files 4096 bytes at a time        
        
def open_cb(handle, exec_type):
        
        handle.read(opt_size, read_cb)
        
# Open a file asynchronously
        
gnomevfs.async.open(filename, open_cb)

------------------------------------------------------------

Thanks a lot folks. 

Thanks

> 
>   PS: the classes VFSAsyncBaseGUI, VFSAsyncLoaderGUI, and
> VFSAsyncSaverGUI in [1] may be useful to you.
> 
> 
> [1] 
> >http://cvs.sourceforge.net/viewcvs.py/numexp/gnumexp/src/xygraph/Numexp_XYGraph/persist.py?view=auto
_______________________________________________
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