Index: gtkradiobutton.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkradiobutton.c,v
retrieving revision 1.59
diff -u -r1.59 gtkradiobutton.c
--- gtkradiobutton.c	13 Sep 2005 19:57:42 -0000	1.59
+++ gtkradiobutton.c	30 Nov 2005 09:53:50 -0000
@@ -33,9 +33,21 @@
 #include "gtkalias.h"
 
 
+typedef struct {
+  gint value;
+} GtkRadioButtonPrivate;
+
+#define GTK_RADIO_BUTTON_GET_PRIVATE(o) \
+        (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
+         GTK_TYPE_RADIO_BUTTON, \
+         GtkRadioButtonPrivate))
+
+
 enum {
   PROP_0,
-  PROP_GROUP
+  PROP_GROUP,
+  PROP_VALUE,
+  PROP_CURRENT_VALUE
 };
 
 
@@ -59,6 +71,7 @@
 static GtkCheckButtonClass *parent_class = NULL;
 
 static guint group_changed_signal = 0;
+static guint changed_signal = 0;
 
 GType
 gtk_radio_button_get_type (void)
@@ -115,6 +128,47 @@
 							P_("The radio button whose group this widget belongs to."),
 							GTK_TYPE_RADIO_BUTTON,
 							GTK_PARAM_WRITABLE));
+
+  /**
+   * GtkRadioButton:value:
+   *
+   * The value is an arbitrary integer which can be used as a
+   * convenient way to determine which button in the group is 
+   * currently active in an ::activate or ::changed signal handler.
+   * See gtk_radio_button_get_current_value() and
+   * gtk_radio_button_set_current_value() * for convenient ways to get
+   * and set this property.
+   *
+   * Since: X.X
+   */
+  g_object_class_install_property (gobject_class,
+				   PROP_VALUE,
+				   g_param_spec_int ("value",
+						     P_("The value"),
+						     P_("The value returned by gtk_radio_button_get_current_value() when this button is the current button of its group."),
+						     G_MININT,
+						     G_MAXINT,
+						     0,
+						     GTK_PARAM_READWRITE));
+
+  /**
+   * GtkRadioButton:current-value:
+   *
+   * The value property of the currently active member of the group to which
+   * this button belongs.
+   *
+   * Since: X.X
+   */
+  g_object_class_install_property (gobject_class,
+				   PROP_CURRENT_VALUE,
+                                   g_param_spec_int ("current-value",
+						     P_("The current value"),
+						     P_("The value property of the currently active member of the group to which this button belongs."),
+						     G_MININT,
+						     G_MAXINT,
+						     0,
+						     GTK_PARAM_READWRITE));
+  
   object_class->destroy = gtk_radio_button_destroy;
 
   widget_class->focus = gtk_radio_button_focus;
@@ -145,6 +199,27 @@
 				       NULL, NULL,
 				       _gtk_marshal_VOID__VOID,
 				       G_TYPE_NONE, 0);
+
+  /**
+   * GtkRadioButton::changed:
+   * @radio_button: the button on which the signal is emitted
+   * @current: the member of @radio_button<!-- -->s group which has just been activated
+   *
+   * The ::changed signal is emitted on every member of a radio group when the
+   * active member is changed. The signal gets emitted after the ::activate signals
+   * for the previous and current active members.
+   *
+   * Since: X.X
+   */
+  changed_signal = g_signal_new (I_("changed"),
+		                 G_OBJECT_CLASS_TYPE (class),
+		                 G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
+		                 G_STRUCT_OFFSET (GtkRadioButtonClass, changed), 
+                                 NULL, NULL,
+		                 g_cclosure_marshal_VOID__OBJECT,
+		                 G_TYPE_NONE, 1, GTK_TYPE_RADIO_BUTTON);
+
+  g_type_class_add_private (class, sizeof (GtkRadioButtonPrivate));
 }
 
 static void
@@ -184,6 +259,14 @@
 	slist = NULL;
       gtk_radio_button_set_group (radio_button, slist);
       break;
+    case PROP_VALUE:
+      gtk_radio_button_set_value (radio_button,
+                                  g_value_get_int (value));
+      break;
+    case PROP_CURRENT_VALUE:
+      gtk_radio_button_set_current_value (radio_button,
+                                          g_value_get_int (value));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -196,8 +279,20 @@
 			       GValue     *value,
 			       GParamSpec *pspec)
 {
+  GtkRadioButton *radio_button;
+
+  radio_button = GTK_RADIO_BUTTON (object);
+
   switch (prop_id)
     {
+    case PROP_VALUE:
+      g_value_set_int (value,
+                       gtk_radio_button_get_value (radio_button));
+      break;
+    case PROP_CURRENT_VALUE:
+      g_value_set_int (value,
+                       gtk_radio_button_get_current_value (radio_button));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -272,6 +367,125 @@
   g_object_unref (radio_button);
 }
 
+/**
+ * gtk_radio_button_get_value:
+ * @radio_button: a #GtkRadioButton
+ * 
+ * Obtains the value property of @radio_button.
+ * 
+ * Return value: The value property of @radio_button
+ *
+ * Since: X.X
+ **/
+gint
+gtk_radio_button_get_value (GtkRadioButton *radio_button)
+{
+  GtkRadioButtonPrivate *priv;
+
+  g_return_val_if_fail (GTK_IS_RADIO_BUTTON (radio_button), 0);
+
+  priv = GTK_RADIO_BUTTON_GET_PRIVATE (radio_button);
+
+  return priv->value;
+}
+
+/**
+ * gtk_radio_button_set_value:
+ * @radio_button: a #GtkRadioButton
+ * @value: a #gint
+ * 
+ * Sets the value property of @radio_button to @value.
+ * 
+ * Since: X.X
+ **/
+void
+gtk_radio_button_set_value (GtkRadioButton *radio_button,
+                            gint            value)
+{
+  GtkRadioButtonPrivate *priv;
+
+  g_return_if_fail (GTK_IS_RADIO_BUTTON (radio_button));
+
+  priv = GTK_RADIO_BUTTON_GET_PRIVATE (radio_button);
+
+  priv->value = value;
+
+  g_object_notify (G_OBJECT (radio_button), "value");
+}
+
+/**
+ * gtk_radio_button_get_current_value:
+ * @radio_button: a #GtkRadioButton
+ * 
+ * Obtains the value property of the currently active member of 
+ * the group to which @radio_button belongs.
+ * 
+ * Return value: The value of the currently active group member
+ *
+ * Since: X.X
+ **/
+gint
+gtk_radio_button_get_current_value (GtkRadioButton *radio_button)
+{
+  GSList *slist;
+  
+  g_return_val_if_fail (GTK_IS_RADIO_BUTTON (radio_button), 0);
+
+  if (radio_button->group)
+    {
+      for (slist = radio_button->group; slist; slist = slist->next)
+	{
+	  GtkToggleButton *toggle_button = slist->data;
+
+	  if (toggle_button->active)
+	    return gtk_radio_button_get_value (GTK_RADIO_BUTTON (toggle_button));
+	}
+    }
+
+  return gtk_radio_button_get_value (radio_button);
+}
+
+/**
+ * gtk_radio_button_set_current_value:
+ * @radio_button: a #GtkRadioButton
+ * @current_value: a #gint
+ * 
+ * Sets the currently active group member to the member with value
+ * property @current_value.
+ *
+ * Since: X.X
+ **/
+void
+gtk_radio_button_set_current_value (GtkRadioButton *radio_button,
+                                    gint            current_value)
+{
+  GSList *slist;
+
+  g_return_if_fail (GTK_IS_RADIO_BUTTON (radio_button));
+
+  if (radio_button->group)
+    {
+      for (slist = radio_button->group; slist; slist = slist->next)
+	{
+	  GtkRadioButton *button = slist->data;
+
+	  if (gtk_radio_button_get_value (button) == current_value)
+            {
+              gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+              return;
+            }
+	}
+    }
+
+  if (gtk_radio_button_get_value (radio_button) == current_value)
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button), TRUE);
+  else
+    {
+      g_warning ("Radio group does not contain a button with value '%d'",
+                 current_value);
+    }
+}
+
 GtkWidget*
 gtk_radio_button_new (GSList *group)
 {
@@ -634,6 +848,17 @@
 	      gtk_button_clicked (GTK_BUTTON (tmp_button));
 	      break;
 	    }
+	}
+
+      tmp_list = radio_button->group;
+      while (tmp_list)
+	{
+	  tmp_button = tmp_list->data;
+	  tmp_list = tmp_list->next;
+
+          g_object_notify (G_OBJECT (tmp_button), "current-value");
+
+	  g_signal_emit (tmp_button, changed_signal, 0, radio_button);
 	}
 
       new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
Index: gtkradiobutton.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkradiobutton.h,v
retrieving revision 1.18
diff -u -r1.18 gtkradiobutton.h
--- gtkradiobutton.h	20 Mar 2005 07:01:22 -0000	1.18
+++ gtkradiobutton.h	30 Nov 2005 09:53:50 -0000
@@ -58,9 +58,10 @@
 
   /* Signals */
   void (*group_changed) (GtkRadioButton *radio_button);
+  void (*changed)       (GtkRadioButton *radio_button,
+                         GtkRadioButton *current);
 
   /* Padding for future expansion */
-  void (*_gtk_reserved2) (void);
   void (*_gtk_reserved3) (void);
   void (*_gtk_reserved4) (void);
 };
@@ -81,6 +82,12 @@
 GSList*    gtk_radio_button_get_group                     (GtkRadioButton *radio_button);
 void       gtk_radio_button_set_group                     (GtkRadioButton *radio_button,
                                                            GSList         *group);
+gint       gtk_radio_button_get_value                     (GtkRadioButton *radio_button);
+void       gtk_radio_button_set_value                     (GtkRadioButton *radio_button,
+                                                           gint            value);
+gint       gtk_radio_button_get_current_value             (GtkRadioButton *radio_button);
+void       gtk_radio_button_set_current_value             (GtkRadioButton *radio_button,
+                                                           gint            current_value);
 
 #ifndef GTK_DISABLE_DEPRECATED
 #define gtk_radio_button_group gtk_radio_button_get_group
