Re: feature wanted: gtk_next_timeout




"Alexander V. Lukyanov" <lav@yars.free.net> writes:

> Hi,
> 
> I'm thinking about an application, which would wait for an event
> itself and then call appropriate function depending on what event
> happened.
> 
> Gtk has now gtk_events_pending, gdk_display, gtk_main_iteration_do -
> almost all that needed. The only function missed is something like
> gtk_next_timeout - to return the time to the next timeout function
> call (or -1 if there is no timeout)
> 
> The function would be very simple, I hope it is possible to add it.

Such a function would be quite simple (since gtk_events_pending
actually already does the necessary work internally). 

I assume that you mention gdk_display because you are planning
to use ConnectionNumber(display) in a select(). This doesn't
cover two possibilities: 

 - GDK needs to wait on other connections from X (for Input Methods,
   or ICE) - this doesn't come up now but could in the future.
 - Somebody has done a gdk_input_add().

Perhaps GDK should have a function to return the complete information
about all the file descriptors it is going to select upon.

The other alternative (would it work for your application?)
would be to allow the programmer to replace the select() that
GTK uses. This is probably the most efficient approach, but
does restrict the structure of the application somewhat.

Regards,
                                        Owen




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