[gimp] app: Add gimp_action_group_set_action_tooltip()



commit 15344ffd6dd41febd6e542f1e5e74186c149bec4
Author: Martin Nordholts <martinn src gnome org>
Date:   Sun Mar 7 11:15:16 2010 +0100

    app: Add gimp_action_group_set_action_tooltip()

 app/widgets/gimpactiongroup.c |   23 +++++++++++++++++++++++
 app/widgets/gimpactiongroup.h |    3 +++
 2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpactiongroup.c b/app/widgets/gimpactiongroup.c
index 3425256..2450792 100644
--- a/app/widgets/gimpactiongroup.c
+++ b/app/widgets/gimpactiongroup.c
@@ -786,6 +786,29 @@ gimp_action_group_set_action_label (GimpActionGroup *group,
 }
 
 void
+gimp_action_group_set_action_tooltip (GimpActionGroup     *group,
+                                      const gchar         *action_name,
+                                      const gchar         *tooltip)
+{
+  GtkAction *action;
+
+  g_return_if_fail (GIMP_IS_ACTION_GROUP (group));
+  g_return_if_fail (action_name != NULL);
+
+  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), action_name);
+
+  if (! action)
+    {
+      g_warning ("%s: Unable to set tooltip of action "
+                 "which doesn't exist: %s",
+                 G_STRFUNC, action_name);
+      return;
+    }
+
+  gtk_action_set_tooltip (action, tooltip);
+}
+
+void
 gimp_action_group_set_action_color (GimpActionGroup *group,
                                     const gchar     *action_name,
                                     const GimpRGB   *color,
diff --git a/app/widgets/gimpactiongroup.h b/app/widgets/gimpactiongroup.h
index 4578bc5..487c6d5 100644
--- a/app/widgets/gimpactiongroup.h
+++ b/app/widgets/gimpactiongroup.h
@@ -186,6 +186,9 @@ void   gimp_action_group_set_action_active    (GimpActionGroup     *group,
 void   gimp_action_group_set_action_label     (GimpActionGroup     *group,
                                                const gchar         *action_name,
                                                const gchar         *label);
+void   gimp_action_group_set_action_tooltip   (GimpActionGroup     *group,
+                                               const gchar         *action_name,
+                                               const gchar         *tooltip);
 void   gimp_action_group_set_action_color     (GimpActionGroup     *group,
                                                const gchar         *action_name,
                                                const GimpRGB       *color,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]