]> Pileus Git - ~andy/gtk/commitdiff
Add an example for manually setting up a group of actions.
authorMatthias Clasen <mclasen@redhat.com>
Tue, 15 Mar 2005 16:33:43 +0000 (16:33 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 15 Mar 2005 16:33:43 +0000 (16:33 +0000)
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.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkradioaction.c

index e6b0b27386677d8c31831e97a0e63d738be352a9..7119276b3542bc2220912077eadabbbbe96f03ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 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.
+
        * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): 
        Document that inline completion requires text-column to be set.
        (gtk_entry_completion_compute_prefix): Return NULL if text-column
index e6b0b27386677d8c31831e97a0e63d738be352a9..7119276b3542bc2220912077eadabbbbe96f03ae 100644 (file)
@@ -1,5 +1,8 @@
 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.
+
        * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): 
        Document that inline completion requires text-column to be set.
        (gtk_entry_completion_compute_prefix): Return NULL if text-column
index e6b0b27386677d8c31831e97a0e63d738be352a9..7119276b3542bc2220912077eadabbbbe96f03ae 100644 (file)
@@ -1,5 +1,8 @@
 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.
+
        * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): 
        Document that inline completion requires text-column to be set.
        (gtk_entry_completion_compute_prefix): Return NULL if text-column
index ec761e176a56ad6a78fc07565ec00459ebda307f..bdf6d302e55a7f01f6e6c346e0c7b14eea61f6ce 100644 (file)
@@ -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
  *