1. Create a header file named gtk_axctl_zzz.h with the following code: #include <time.h> extern "C" static gboolean gtk_axctl_rest(gpointer data) { static struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = 1000; nanosleep(&ts, NULL); return TRUE; }2. #include gtk_axctl_zzz.h in the source file3. before gtk_main(), put: g_idle_add(gtk_axctl_rest, NULL);User needs to include /usr/lib/librt.so library in the compiling script also.