summaryrefslogtreecommitdiff
path: root/gtk/gtkradioaction.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-03-15 16:33:43 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-03-15 16:33:43 +0000
commit1b2584a8acc380dc6723b5d76fc36ff279596a30 (patch)
treee7d2b53a2dbcdbd0cf35aade32ba67ea159a6670 /gtk/gtkradioaction.c
parent0e86016442117d8ababe9f6a5907a0d5edd5b47e (diff)
downloadgdk-pixbuf-1b2584a8acc380dc6723b5d76fc36ff279596a30.tar.gz
Add an example for manually setting up a group of actions.
2005-03-15 Matthias Clasen <mclasen@redhat.com> * gtk/gtkradioaction.c (gtk_radio_action_get_group): Add an example for manually setting up a group of actions.
Diffstat (limited to 'gtk/gtkradioaction.c')
-rw-r--r--gtk/gtkradioaction.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gtk/gtkradioaction.c b/gtk/gtkradioaction.c
index ec761e176..bdf6d302e 100644
--- a/gtk/gtkradioaction.c
+++ b/gtk/gtkradioaction.c
@@ -233,6 +233,8 @@ gtk_radio_action_finalize (GObject *object)
action = GTK_RADIO_ACTION (object);
+ g_print ("finalize %p\n", action);
+
action->private_data->group = g_slist_remove (action->private_data->group, action);
tmp_list = action->private_data->group;
@@ -373,7 +375,23 @@ create_menu_item (GtkAction *action)
* gtk_radio_action_get_group:
* @action: the action object
*
- * Returns the list representing the radio group for this object
+ * Returns the list representing the radio group for this object.
+ * Note that the returned list is only valid until the next change
+ * to the group.
+ *
+ * A common way to set up a group of radio group is the following:
+ * <informalexample><programlisting>
+ * GSList *group = NULL;
+ * GtkRadioAction *action;
+ *
+ * while (/<!-- -->* more actions to add *<!-- -->/)
+ * {
+ * action = gtk_radio_action_new (...);
+ *
+ * gtk_radio_action_set_group (action, group);
+ * group = gtk_radio_action_get_group (action);
+ * }
+ * </programlisting></informalexample>
*
* Returns: the list representing the radio group for this object
*