Re: GUI window creation from a thread



You should not create widgets from threads other than the main thread.

To overcome this problem I use idle time processing callback (using g_idle_add() method). Basically, you have to create some idle time requests queue, that will create and display windows/messages etc. Then you can create the request from your thread (and optionally block until some mutex signals that the message box you wanted to be shown was closed).

For the details, you can download Atol source code (http://atol.sourceforge.net/) and see files ThreadSafeGui and ThreadSaveMsgs.

Regards,
 Miroslav

----- Original Message ----- From: "Preeti Joshi" <preetijoshi79 gmail com>
To: <gtk-app-devel-list gnome org>
Sent: Monday, January 08, 2007 11:33 AM
Subject: GUI window creation from a thread


Hi,

Is it not possible to create a GUI window from a thread? I created a thread from a button_click callback and from within the thread I need to display a popup message . But everytime a GUI operation like widget show or destroy is
done, it displays following error messages:
Xlib: unexpected async reply (sequence 0x24e)!
Xlib: sequence lost (0x10000 > 0x3e3) in reply type 0x0!

What is the get-around for this problem?
Please help
Preeti
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

__________ NOD32 1945 (20061229) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com






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