用于更新UI的C GTK +定期事件(C GTK+ periodic event to update the UI)
如何在定期事件上更新GTK +接口。 例如,假设我想要每200毫秒更新一个包含时间的文本字段。 这通常是怎么做的?
更新:
另一个问题( 如何在gtk应用程序中执行定期作业? )提到g_timeout_add。 这是最好的方法吗? 在那个帖子中说它可能效率不高?
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?
最满意答案
本教程有一个例子。 (搜索标题为“计时器示例”的部分。)
简短的回答是“使用g_timeout_add ”。
This tutorial has an example. (Search for the section titled "A timer example".)
The short answer is "use g_timeout_add".
更多推荐
发布评论