Dutta, Seemanta wrote:
> But I would still like to know how to do this using threading.
> I tried
> http://research.operationaldynamics.com/blogs/andrew/software/gnome-desk
> top/gtk-thread-awareness.html hoping it would solve my problem but even
> that did not work :-(

It's very easy.  Whenever your thread wants to update the GUI, use the
g_idle_add() call from within the thread to ask the main loop to run
some callback function.  Then the callback function can update the GUI,
from the main thread.  Of course things like setting how far the
progress bar should go need to be done with data structures that would
be shared between the worker thread and the main thread.  If there is
ever a possibility that the main thread will also have to write to these
data structures, then you'll need to use synchronization primitives
around them.

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to