Re: External event loop for glib?



On 03/23/99, Helge Hess said:
>Elliot Lee wrote:
>> On Tue, 23 Mar 1999, Helge Hess wrote:
>> > Antti Huima wrote:
>> > >
>> > > The only major problem seems to be that glib has its own event loop. We
>> > > have an own event loop and would prefer using it instead.
>> >
>> > We have exactly the same problem and would love to have a generic
>> > interface.
>> 
>> I'm curious, what doesn't the glib event loop provide that is needed?
>
>Just had a look again and what is confusing is gtk_main. gtk_main
>doesn't only enter the runloop but initializes stuff as well. So what
>(IMHO) would be needed are functions like this:
>
>  gtk_prepare();
>  FD_SET descriptors = gtk_runloop_descriptors();
>  // own runloop
>    if (descriptors were busy)
>      gtk_handle_descriptors(descriptors)
>  gtk_finish();
>
>Right ? The way it currently is I have to copy most of gtk_main's code,
>right ?

You can't just do FDs, since timers in the main loop need to be taken
account for.. for example.. lets say you had a a blinking cursor.. there is
a timer in gtk setup to make it blink... if you only select on FDs, you
could have a situation where no FDs wake up (no X events), so you would
never give gtk any time to process its own events (like that timer) and
your cursors would stop blinking.

This is a pretty amjor problem in Xt too. :(

What the api needs is a way to not only get gtk descriptors, but also find
out the maximum time we can stay blocked before giving gtk some cpu time.

-- 
___________________________________________________________________________
Danny Dulai                                           Feet. Pumice. Lotion.
http://www.ishiboo.com/~nirva/                            nirva@ishiboo.com



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