RE: gtk main and slemr main

regarding this issue, our 'middleware has specific functions for x window 
based applications where we use it for motif
and in the application one is expected to call XtVaAppInitialize - which I 
guess initializes the x window environment.  This call is needed for some 
of our
Middleware stuff.  Is x - window based application calls like the one above 
supported by GTK+ or not?

To answer Havoc, I do not think the middleware main loop can be a slave to 
GTK+ main loop, but I am looking to this possibility but I don't think 
there can be any interrupts for middleware's main loop.  I have started 
looking at threads, is this a bad idea when using two main event loops.


-----Original Message-----
From:	Havoc Pennington [SMTP:hp redhat com]
Sent:	Sunday, October 08, 2000 7:07 PM
To:	Matt Eisemann
Cc:	'otaylor redhat com'; 'gtk-list gnome org'
Subject:	Re: gtk main and slemr main

Matt Eisemann <meisemann dsrnet com> writes:
> Maybe I don't know a lot about sockets and how
> they work with tcp/ip and udp/ip but how could I use sockets or
> gtk_idle_add or some feature since I have two loops which I can not 
> have.
>   gtk_main()
>   middleware_main()
>   I have to keep track of which messages are being sent to me that I
> registered for on the network in addition to the callbacks for the GTK+ 
> buttons and events there.
>   Any ideas or suggestion are greatly welcome.  Thanks.

What Owen is saying is that you need to make the middleware main loop
a slave to the GTK main loop. Many libraries with main loops provide
hooks that would allow this; essentially the hooks you need are a) the
file descriptors middleware is selecting on and b) a function
middleware_process_events() that's called when there's data on those
file descriptors. Then you connect the file descriptors to the GLib
main loop using g_io_add_watch(), and in the callback for
g_io_add_watch() you call middleware_process_events().

Middleware may have some other kinds of hooks, maybe a simple
middleware_check_events_pending() or the like; that could be made to
work too, perhaps with a custom GLib main loop source instead of using
the IO source.

You might contact the middleware vendor and ask them what features
they have to facilitate this type of thing.


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