Combining GTK_MAIN_LOOP with another event loop
- From: the pro <thepro4ever gmail com>
- To: gtk-list gnome org
- Subject: Combining GTK_MAIN_LOOP with another event loop
- Date: Sun, 18 Mar 2012 10:55:41 -0400
I have implemented a separate networking application with libevent and also a GTK Gui. I'm struggling to understand how to integrate the event loops of the two technologies. When my clients connect to the server the server will return a list of entries to be added to a gtkliststore on the client end. What I need to know is how to combine both a libevent event loop,i.e. event_base_loop(base, 0); , with a gtk loop, gtk_main() so that I'm watching events from both technologies. All attempts I've made thus far tax the cpu:
/*Bad CODE*/
while(1) {
gtk_main_iteration_do (FALSE);
event_base_loop(base, 1);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]