Re: Xlib: unexpected async reply (sequence #####)!
- From: Gabriel Schulhof <nix go-nix ca>
- To: Gregory Hosler <ghosler redhat com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Xlib: unexpected async reply (sequence #####)!
- Date: Sun, 05 Aug 2007 10:06:42 +0300
On Sun, 2007-08-05 at 11:29 +0800, Gregory Hosler wrote:
I'm looking for code examples specifically on how to use/implement g_idle_add().
Know any projects that uses g_idle_add() and related infrastructure?
static gboolean
make_insensitive_idle_cb(gpointer data)
{
GtkWidget *widget = GTK_WIDGET(data);
gtk_widget_set_sensitive(widget, FALSE);
/* Return FALSE so as not to keep executing this function over and over
again */
return FALSE;
}
static gpointer
my_thread(gpointer data)
{
/* ... do something of long duration, during which ... */
g_idle_add(make_insensitive_idle_cb, some_widget);
/* ... do the rest of the long duration stuff ... */
return NULL;
}
Have a look at
http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html#id2603517
HTH,
Gabriel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]