Re: [gtk-list] gtk_main() and foreign event loops
- From: erik it et tudelft nl (Erik Mouw)
- To: gtk-list redhat com
- Subject: Re: [gtk-list] gtk_main() and foreign event loops
- Date: Tue, 25 Jan 2000 16:53:18 +0100 (CET)
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/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]