[Sugar-devel] Is there a way to purposefully do synchronous GUI updates?

Ajay Garg ajay at activitycentral.com
Tue Aug 21 06:14:13 EDT 2012


Benjamin,

I am using this to show the upload-progress of a 4 GB file, using
gtk.ProgressBar().

The file takes about 15 minutes to upload, and I only see the progress bar
(fraction = 1) right at the end; which means that only after the uploading
is done, and there is nothing else to be done, does the GUI update takes
place.





Also, I was just going through
http://developer.gnome.org/glib/2.30/glib-The-Main-Event-Loop.html<http://developer.gnome.org/glib/2.30/glib-The-Main-Event-Loop.html#g-idle-add>

There I observed, that by using the combination of ::
http://developer.gnome.org/glib/2.30/glib-The-Main-Event-Loop.html#g-idle-source-new
http://developer.gnome.org/glib/2.30/glib-The-Main-Event-Loop.html#g-source-attach

we could solve our purpose, since the "g-source-attach" can be done in a
different context, whose mainloop would be running in a different thread.
But I did not find the corresponding methods for Python.

Am I missing something?


Regards,
Ajay

On Tue, Aug 21, 2012 at 3:39 PM, Benjamin Berg <benzea at sugarlabs.org> wrote:

> On Tue, 2012-08-21 at 14:19 +0530, Ajay Garg wrote:
> > Damn. Doesn't work :-(
>
> I am a bit surprised. It should work fine, it may of course be that the
> redraws happen so fast, that you don't see all of them.
>
> Benjamin
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120821/bc55e9ab/attachment.html>


More information about the Sugar-devel mailing list