Creating a popup from an event of another Thread


I will design a GTKmm application with two threads. One for UI (high priority) and another (lower priority) waiting for network events. This way the UI response
time will be fast.

Everything work fine except one particular case. Let's imagine the network
thread fire an event, and UI should respond by creating a popup.

I have tried several methods to communicate and interact between threads
but none solved my problem.

Method 1 :
- I have added a gtk idle function to UI thread, that pop events received from the network thread. If I create a popup from the gtk idle, it is displayed but the screen freeze. I think it's because the popup has been created outside the GTK
event loop. Am I right ?

Method 2 :
- The network thread has a sigc::signal that I have connected to a Gtk::Window.
When I fire the signal, I get this error message :

Xlib: unexpected async reply (sequence 0xf6)!
(main:22651): Gdk-CRITICAL **: gdk_window_set_geometry_hints: assertion `window != NULL' failed (main:22651): Gdk-CRITICAL **: gdk_window_move_resize: assertion `window != NULL' failed

Any idea to solve, or explain this problem ?

Thanks in advance,


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