summaryrefslogtreecommitdiff
path: root/gtk/gtkaction.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-01-09 18:07:14 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-01-09 18:07:14 +0000
commitf23bdf7a6803e2041db6c071ba66f73f2adc23bd (patch)
tree71da3dfa4915690f7a391c1804c785044ae08406 /gtk/gtkaction.c
parenteb590e8487685f526dd764179635b02fbc1dc9ad (diff)
downloadgtk+-f23bdf7a6803e2041db6c071ba66f73f2adc23bd.tar.gz
New function to get the action for a proxy. (#326288)
2006-01-09 Matthias Clasen <mclasen@redhat.com> * gtk/gtk.symbols: * gtk/gtkaction.h: * gtk/gtkaction.c (gtk_widget_get_action): New function to get the action for a proxy. (#326288)
Diffstat (limited to 'gtk/gtkaction.c')
-rw-r--r--gtk/gtkaction.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c
index 06b4f8054a..efaf18ce91 100644
--- a/gtk/gtkaction.c
+++ b/gtk/gtkaction.c
@@ -980,9 +980,10 @@ gtk_action_disconnect_proxy (GtkAction *action,
* @action: the action object
*
* Returns the proxy widgets for an action.
+ * See also gtk_widget_get_action().
*
- * Return value: a #GSList of proxy widgets. The list is owned by the action and
- * must not be modified.
+ * Return value: a #GSList of proxy widgets. The list is owned by GTK+
+ * and must not be modified.
*
* Since: 2.4
**/
@@ -996,6 +997,27 @@ gtk_action_get_proxies (GtkAction *action)
/**
+ * gtk_widget_get_action:
+ * @widget: a #GtkWidget
+ *
+ * Returns the #GtkAction that @widget is a proxy for.
+ * See also gtk_action_get_proxies().
+ *
+ * Returns: the action that a widget is a proxy for, or
+ * %NULL, if it is not attached to an action.
+ *
+ * Since: 2.10
+ */
+GtkAction*
+gtk_widget_get_action (GtkWidget *widget)
+{
+ g_return_val_if_fail (GTK_IS_WIDGET (action), NULL);
+
+ return g_object_get_qdata (G_OBJECT (widget), quark_gtk_action_proxy);
+}
+
+
+/**
* gtk_action_get_name:
* @action: the action object
*