How to perform a periodic task in a gtk application?

I need to create a gtk-based GUI application that checks socekets for incoming messages and displays statistics as they are collected without any user input. How can this be organized?

+1
source share
1 answer

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

+1
source

All Articles