From 8da012bac198553c909d6e83f24b02d6b9f3789f Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 1 Dec 2008 23:39:19 +0100 Subject: [PATCH] Use blurb as tooltip in katze_property_proxy --- katze/katze-utils.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/katze/katze-utils.c b/katze/katze-utils.c index 6753bbcf..faed5d34 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -316,6 +316,7 @@ katze_property_proxy (gpointer object, widget = gtk_label_new (gettext (nick)); g_free (string); + gtk_widget_set_tooltip_text (widget, g_param_spec_get_blurb (pspec)); gtk_widget_set_sensitive (widget, pspec->flags & G_PARAM_WRITABLE); g_object_set_data_full (G_OBJECT (widget), "property", @@ -337,17 +338,23 @@ GtkWidget* katze_property_label (gpointer object, const gchar* property) { + GObjectClass* class; + GParamSpec* pspec; + const gchar* nick; + GtkWidget* widget; + g_return_val_if_fail (G_IS_OBJECT (object), NULL); - GObjectClass* class = G_OBJECT_GET_CLASS (object); - GParamSpec* pspec = g_object_class_find_property (class, property); + + class = G_OBJECT_GET_CLASS (object); + pspec = g_object_class_find_property (class, property); if (!pspec) { g_warning (_("Property '%s' is invalid for %s"), property, G_OBJECT_CLASS_NAME (class)); return gtk_label_new (property); } - const gchar* nick = g_param_spec_get_nick (pspec); - GtkWidget* widget = gtk_label_new (nick); + nick = g_param_spec_get_nick (pspec); + widget = gtk_label_new (nick); return widget; } -- 2.39.5