Re: Updating GUI during long operation



Il Fri, 26 Apr 2013 02:24:01 -0700 Kip Warner <kip thevertigo com> scrisse:

On Thu, 2013-04-25 at 22:18 -0700, Simon Feltman wrote:

Similarly, use
Gdk.threads_add_idle instead of GObject.idle_add for scheduling GUI updates
from worker threads. The necessity of these is still somewhat unclear to me
at the moment though.

I'll give that a try. I'm not sure what the difference is either, but
the link above seems to recommend it too so it can't hurt to try.

gdk_threads_add_idle() is only a convenient way of calling g_idle_add()
without the need of decorating the callback code with a
gdk_threads_enter()/gdk_threads_leave() pair:

http://developer.gnome.org/gdk/stable/gdk-Threads.html#gdk-threads-add-idle-full

The code of the dispatcher can be found here:
http://git.gnome.org/browse/gtk+/tree/gdk/gdk.c?id=3.8.1#n779

Ciao.
-- 
Nicola


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]