+typedef struct _ActionStatus ActionStatus;
+
+struct _ActionStatus {
+ GtkAction *action;
+ GtkWidget *statusbar;
+};
+
+static void
+action_status_destroy (gpointer data)
+{
+ ActionStatus *action_status = data;
+
+ g_object_unref (action_status->action);
+ g_object_unref (action_status->statusbar);
+
+ g_free (action_status);
+}
+
+static void
+set_tip (GtkWidget *widget)
+{
+ ActionStatus *data;
+ gchar *tooltip;
+
+ data = g_object_get_data (G_OBJECT (widget), "action-status");
+
+ if (data)
+ {
+ g_object_get (G_OBJECT (data->action), "tooltip", &tooltip, NULL);
+
+ gtk_statusbar_push (GTK_STATUSBAR (data->statusbar), 0,
+ tooltip ? tooltip : "");
+
+ g_free (tooltip);
+ }
+}
+
+static void
+unset_tip (GtkWidget *widget)
+{
+ ActionStatus *data;
+
+ data = g_object_get_data (G_OBJECT (widget), "action-status");
+
+ if (data)
+ gtk_statusbar_pop (GTK_STATUSBAR (data->statusbar), 0);
+}
+
+static void
+connect_proxy (GtkAction *action,
+ GtkWidget *proxy,
+ GtkWidget *statusbar)
+{
+ if (GTK_IS_MENU_ITEM (proxy))
+ {
+ ActionStatus *data;
+
+ data = g_object_get_data (G_OBJECT (proxy), "action-status");
+ if (data)
+ {
+ g_object_unref (data->action);
+ g_object_unref (data->statusbar);
+
+ data->action = g_object_ref (action);
+ data->statusbar = g_object_ref (statusbar);
+ }
+ else
+ {
+ data = g_new0 (ActionStatus, 1);
+
+ data->action = g_object_ref (action);
+ data->statusbar = g_object_ref (statusbar);
+
+ g_object_set_data_full (G_OBJECT (proxy), "action-status",
+ data, action_status_destroy);
+
+ g_signal_connect (proxy, "select", G_CALLBACK (set_tip), 0);
+ g_signal_connect (proxy, "deselect", G_CALLBACK (unset_tip), 0);
+ }
+ }
+}
+