On 05/09/2011 01:36 PM, Gabriele Greco wrote:
just a note on your example code: use the GPOINTER_TO_INT and
GINT_TO_POINTER macro's to avoid 64bit portability problems:
gboolean mycbk(gpointer data)
{
gint val = GPOINTER_TO_INT(data);
char buffer[16];
sprintf(buffer, "%09d", val);
gtk_label_set_text(l, buffer);
return FALSE;
}
void threadfunc(void *unused) {
gint msec = 0;
while (1) {
msec++;
g_usleep(1000);
g_idle_add((GSourceFunc)mycbk, GINT_TO_POINTER(msec));
}
}
Olivier
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list