RE: [gtk-list] Re: gtk_main() and foreign event loops



Hi, I read your answer, I'm not using CORBA, but somthing similar, that also
requieres
regular "listening", and that is encapsulated enough not to let me give gtk
the sockets
directly. I was doing the trick with gtk_timeout_add and was wondering about
idle instead..
is idle better than timeout ?? (and why ?) I was somewhat thinking that the
"idle" wouldn't be "regular" enough, and that it would call the main_sniff
too often when having nothing better to do,
thus raising the cpu consuming sky high, and not calling it at all while
busy with anything else, thus
leting the app answer network events way too late. I was hoping the timeout
would be somewhat "fair" and would let the app have a regular behavior...
what do you think ???+
i didn't fnd much doc about it (I don't say there is not though, I just
didn't find it)
were my assumptions wrong ? any suggestion ??

thank you
cheers..

Olivier.

-----Mensaje original-----
De: Erik Mouw <erik@it.et.tudelft.nl>
Para: gtk-list@redhat.com <gtk-list@redhat.com>
Fecha: Martes, 25 de Enero de 2000 10:03 a.m.
Asunto: [gtk-list] Re: gtk_main() and foreign event loops


>Alexander Taranov wrote:
>> I want to use GTK in CORBA based server (Orbix or ORBACUS)
>> Both ORB's have a mechanism to incorporte
>> Xt event loop.
>>
>> DOes anybody know how to do this with gtk_main() ??
>
>The trick is to run the event loop of the first component as an idle
>task in the event loop of the other component.
>
>For example: suppose your Corba thingy has a way to process events like:
>
>  while(corba_events_available())
>    process_corba_event();
>
>Make a function like:
>
>  int do_corba_events(gpointer data)
>  {
>    while(corba_events_available())
>      process_corba_event();
>
>    return(TRUE);
>  }
>
>Add an idle function to GTK+:
>
>  int corba_id;
>
>  corba_id = gtk_idle_add(GtkFunction)do_corba_event, NULL);
>
>Now run GTK+ in the normal way, and your Corba event loop will be called.
>Another way to accomplish this is by using gtk_timeout functions, or by
>creating your own event loop that calls both GTK and Corba.
>
>BTW: I fail to see why a _server_ needs a GUI.
>
>
>Erik
>
>--
>J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
>of Electrical Engineering, Faculty of Information Technology and Systems,
>Delft University of Technology, PO BOX 5031,  2600 GA Delft, The
Netherlands
>Phone: +31-15-2785859  Fax: +31-15-2781843  Email J.A.K.Mouw@its.tudelft.nl
>WWW: http://www-ict.its.tudelft.nl/~erik/
>
>--
>To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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