To add one other question, I also want to get the value of XtAppContext if 
I can since I need to pass this value into a middleware function that we 
use.  Can these values be obtained or not.  If I can't init the x 
invironment and the gtk_init also, am i out of luck or if I can, how do I 
init them both?  Can I just call gtk_init then XtVaAppInitialize.
Thanks ahead of time for your help.

Matt



-----Original Message-----
From:   Matt Eisemann [SMTP:[EMAIL PROTECTED]]
Sent:   Friday, October 13, 2000 12:05 PM
To:     'Havoc Pennington'
Cc:     '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject:        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.

Matthew



-----Original Message-----
From:   Havoc Pennington [SMTP:[EMAIL PROTECTED]]
Sent:   Sunday, October 08, 2000 7:07 PM
To:     Matt Eisemann
Cc:     '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject:        Re: gtk main and slemr main


Matt Eisemann <[EMAIL PROTECTED]> 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 
clearly
> 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+ 
GUI
> 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.

Havoc


_______________________________________________
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to