用于更新UI的C GTK +定期事件(C GTK+ periodic event to update the UI)

系统教程 行业动态 更新时间:2024-06-14 16:57:17
用于更新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".

更多推荐

本文发布于:2023-04-12 20:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/825975effbb2f26e1d57607c452d1ef7.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:事件   GTK   UI   update   event

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!