C GTK+ periodic event to update the UI

给你一囗甜甜゛ 提交于 2020-01-11 10:19:06

问题


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?


回答1:


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

The short answer is "use g_timeout_add".



来源:https://stackoverflow.com/questions/6240691/c-gtk-periodic-event-to-update-the-ui

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!