Re: [gnome-db] libgda in apps with own main event loop ?



On Sun, 2003-06-01 at 10:58, Joseph Wenninger wrote:
> Hi
> 
> I have an X application, which has it's own (non gtk/ non gnome / non
> bonobo/ ....) main event loop. Is it possible to use libgda in such an
> application ?
> 
yes, you just need to make sure you also run the GLib main loop. For
that, you can use the g_main_loop/g_main_context functions.
Specifically, you'll want to use g_main_context_iteration, which runs an
iteration of the main loop.

Thus, you only need to be sure you call that function from your other
event loop.

> 1)I thought about running the gda main event loop in a second thread of
> my application, would that be possible ?
>
yes, although as I said, it's not needed. GDA main loop is just a thin
wrapper around g_main_* functions, so you just need to use GLib's
functions directly instead.

>  Would it be possible to run
> more than one gda main event loop in different threads ?
>
yes

>  (Since it is a
> plugin, where I want to use libgda, I can't guarantee,that no other
> plugin wants to do the same "hack").
> 2) My second thought has been running a second process and exchanging
> data with a named pipe or shared memory.
>
not needed at all. Just integrate the GLib event loop into your other
loop. That's all you need.

cheers




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