Search code examples
ceventsgtk

C GTK+ periodic event to update the UI


How can I update a GTK+ interface on a periodic event. For example, let's say I wanted to update a text field containing the time every 200 milliseconds. How is this typically done?


Update:

Another question (How one executes a periodic job in gtk application?) mentiones g_timeout_add. Is this the best way to go about doing this? It is said in that thread that it may not be efficient?


Solution

  • This tutorial has an example. (Search for the section titled "A timer example".)

    The short answer is "use g_timeout_add".