How one executes a periodic job in gtk application?
I need to make an applica开发者_StackOverflow中文版tion 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?
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+.
精彩评论