Re: multithreading gtk app
- From: jcupitt gmail com
- To: Mick <bareman tpg com au>
- Cc: "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: Re: multithreading gtk app
- Date: Wed, 30 Jun 2010 08:35:07 +0100
On 30 June 2010 01:57, Mick <bareman tpg com au> wrote:
can anyone point me to an explanation (with examples) to help me
understand running some dialogs in separate threads. (eg. help,
preferences, etc)
It's almost always best to only have a single GUI thread in a gtk
application, in my experience.
Use non-modal dialogs if you want your app to continue to function
while a dialog is being displayed.
If you have a long task which shouldn't block the GUI, put it in a
background thread and use g_idle_add() to have it signal the main
thread when it's done. I posted some example code to do this a little
while ago:
http://old.nabble.com/g_main_loop-and-g_async_queue-td21288177.html
(scroll down a bit)
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]