[Glade-users] Sending events (somewhat OT)



On Tue, Mar 17, 2009 at 9:38 PM, Steve <zephod at cfl.rr.com> wrote:
The helper thread that handles the USB input data sends a client event containing the data I want displayed 
to the main thread with a gtk_propagate_event ( main_window, client_msg ) call.

In the main UI thread a client event callback on the main_window widget is triggered which writes the data 
to the TreeView widget which is contained in a dialog box which may or may not be displayed at that time. 
At the end of this callback I put a g_idle_add_full ( G_PRIORITY_HIGH_IDLE, trigger_display, NULL, NULL ) 
call. Everything up to this point gets executed when data arrives from the USB but the trigger_display() 
function does not.

Why are you using an synthesized event and gtk_propagate_event() ?

Calling gtk_propagate_event() from the thread is not safe, it will execute
the GUI code from the thread, why not just use an idle to communicate
with the main thread and update treemodel, queue_draw() from there ?


Previously I had thought that trigger_display() was called as soon as I moved the mouse but I have now 
realized that it gets called only when I move the mouse over one of the applications windows. Is that an 
enter-notify-event?

Steve.







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