[Glade-users] Sending events (somewhat OT)
His Majesty
balakkvj at gmail.com
Sat Mar 14 05:23:59 EDT 2009
2009/3/14 Steve Blackwell <zephod at cfl.rr.com>:
> I have written a program using glade 3 that has 2 threads. The main
> thread handles user input from the GUI while the second thread monitors
> a USB port for input. When data arrives at the USB port, it is processed
> and written to a GtkTreeView widget.
>
> The problem is that the data does not appear in the TreeView until I
> move the mouse or press a key. I think that this is because the main
> thread controlling the GUI is blocking in gtk_main() until an event
> arrives. So I added code to the second thread to send a
> GDK_CLIENT_EVENT to the GtkDialog widget that contains the TreeView.
>
> It didn't work.
>
> I can tell that the event was sent and received because
> I added a client-event callback to the GtkDialog window and I can see
> that this got executed. The callback doesn't do anything but I assumed
> (clearly incorrectly) that the arrival of the event would cause
> gtk_main() to loop and paint the pending Treeview data.
>
> What am I doing wrong here?
>
> Thanks for any suggestions.
> Steve.
> _______________________________________________
> Glade-users maillist - Glade-users at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-users
>
Obviously the gtk_main expects a return.
You can stop this behaviour using g_main_context_iteration (NULL,FALSE);
See if this works for you.
B
--
BalaKrishna Kolluru
More information about the Glade-users
mailing list