Python GTK GUI struck when process is going on.

Michael Torrie torriem at gmail.com
Fri Jan 10 01:19:08 EST 2014


On 01/09/2014 08:15 AM, MRAB wrote:
> On 2014-01-09 11:53, Prapulla Kumar wrote:
>> Hi all,
>> I'm using python gtk to upload file to S3 service by boto API ,
>> GUI struck when uploading file and releases the GUI after completed download
>> I'm using thread to show progress of upload in GUI but it struck.
>> Can you some suggestion how to show progress of upload in GUI or any
>> spinner until upload finish
>>
> You say that you're using a thread to show the progress. Does that mean
> that you're doing the uploading in the main thread?
> 
> If yes, then that's the wrong way round. It's the uploading that needs
> to be done in the background thread.

And you can post update messages from the thread using a queue of some
kind.  The GUI just has to have a timeout that checks the queue and
updates the gui with messages (percent complete, bytes transferred,
etc). Or have the thread use gobject.idle_add to schedule a callback in
the main thread that will check on the upload status and update the GUI.



More information about the Python-list mailing list