[gtk+] Fix "active" property not being notified
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Fix "active" property not being notified
- Date: Wed, 14 Oct 2009 16:47:08 +0000 (UTC)
commit aa663e08f7fad8fe277eca2bab9dd7233422b6db
Author: Bastien Nocera <hadess hadess net>
Date: Wed Oct 14 17:46:11 2009 +0100
Fix "active" property not being notified
And setting it FALSE starting the spinning when it should
stop it.
gtk/gtkspinner.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c
index ec3ebb3..63a6477 100644
--- a/gtk/gtkspinner.c
+++ b/gtk/gtkspinner.c
@@ -151,7 +151,10 @@ gtk_spinner_set_property (GObject *object,
switch (param_id)
{
case PROP_ACTIVE:
- gtk_spinner_start (GTK_SPINNER (object));
+ if (g_value_get_boolean (value))
+ gtk_spinner_start (GTK_SPINNER (object));
+ else
+ gtk_spinner_stop (GTK_SPINNER (object));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -496,6 +499,7 @@ gtk_spinner_start (GtkSpinner *spinner)
return;
}
priv->timeout = gdk_threads_add_timeout (1000 / priv->num_steps, gtk_spinner_timeout, spinner);
+ g_object_notify (G_OBJECT (spinner), "active");
}
/**
@@ -519,6 +523,7 @@ gtk_spinner_stop (GtkSpinner *spinner)
}
g_source_remove (priv->timeout);
priv->timeout = 0;
+ g_object_notify (G_OBJECT (spinner), "active");
}
#define __GTK_SPINNER_C__
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]