I create an event with g_timeout_addor g_timeout_add_secondsthat returns the event identifier; I can cancel the event by calling g_source_remove.
g_timeout_add
g_timeout_add_seconds
g_source_remove
However, at some point I would like to see how much time is left until the event is fired. Is there an easy way to do this using the glib api, or do I need to manually store and compare timestamps with g_source_get_current_time?
g_source_get_current_time
There is no sensible way to do this in GLib.
GSource (g_main_context_find_source_by_id), source- > source_funcs- > prepare() GSource, , . : source_funcs , prepare() , .
, . .
+ -, , .