怎么一执行在GTK应用程序定期的工作吗? [英] How one executes a periodic job in gtk application?

查看:145
本文介绍了怎么一执行在GTK应用程序定期的工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要与GUI构建在GTK,用于检查传入的消息并显示出统计socekets,因为它们不受用户的任何开关输入云集的应用程序。
这怎么组织的?

I need to make an application with GUI built on gtk, that checks socekets for incoming messages and displays statistics as they are gathered without any imput from user. How can this be organised?

推荐答案

我想知道如何使用PyGTK的,并PyGObject做到这一点,但我从来没有做过C.类似的东西不过,我有一个建议给你:试试 g_io_add_watch 从glib函数,(这是GObject的基础以及)。它运作良好的Python为我的(并且是更实用的BTW使用)和Python版本仅仅是原来​​的C函数的包装。因为GTK +是基于GObject的中和图形对象使用GLib的广泛应用,你已经拥有这个功能在开发环境中,它应该与GTK +工作得很好。

I'd know how to do it using PyGtk and PyGObject but I never did something like it in C. However, I have a suggestion to you: try the g_io_add_watch function from GLib (which is base for GObject as well). It worked well in Python for me (and were much more practical to use BTW) and the Python version is just a wrapper for the original C function. Since GTK+ is based in GObject and GObject uses GLib extensively, you already have this function available in your development environment and it should work well with GTK+.

这篇关于怎么一执行在GTK应用程序定期的工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆