diff options
author | Matthias Clasen <maclas@gmx.de> | 2004-01-14 01:33:53 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-01-14 01:33:53 +0000 |
commit | ecb75e12b59d23a49efc375c105b15ad15a2b8ee (patch) | |
tree | 7c48c68cdf1ec7a6af4c630ed2c81a3f7aaedeaf /gtk/gtkradioaction.c | |
parent | f85e40e322399f6d751421a217288894c8d6976b (diff) | |
download | gtk+-ecb75e12b59d23a49efc375c105b15ad15a2b8ee.tar.gz |
Add a writable group property to align with the GtkRadioButton API.
Wed Jan 14 02:34:57 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkradioaction.c: Add a writable group property to align
with the GtkRadioButton API. (#129166, Olivier Andrieu)
Diffstat (limited to 'gtk/gtkradioaction.c')
-rw-r--r-- | gtk/gtkradioaction.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/gtk/gtkradioaction.c b/gtk/gtkradioaction.c index 35460a33b8..f61168c316 100644 --- a/gtk/gtkradioaction.c +++ b/gtk/gtkradioaction.c @@ -53,7 +53,8 @@ enum enum { PROP_0, - PROP_VALUE + PROP_VALUE, + PROP_GROUP }; static void gtk_radio_action_init (GtkRadioAction *action); @@ -142,6 +143,21 @@ gtk_radio_action_class_init (GtkRadioActionClass *klass) G_PARAM_READWRITE)); /** + * GtkRadioAction:group: + * + * Sets a new group for a radio action. + * + * Since: 2.4 + */ + g_object_class_install_property (gobject_class, + PROP_GROUP, + g_param_spec_object ("group", + _("Group"), + _("The radio action whose group this action belongs."), + GTK_TYPE_RADIO_ACTION, + G_PARAM_WRITABLE)); + + /** * GtkRadioAction::changed: * @action: the action on which the signal is emitted * @current: the member of @action<!-- -->s group which has just been activated @@ -247,6 +263,20 @@ gtk_radio_action_set_property (GObject *object, case PROP_VALUE: radio_action->private_data->value = g_value_get_int (value); break; + case PROP_GROUP: + { + GtkRadioAction *arg; + GSList *slist = NULL; + + if (G_VALUE_HOLDS_OBJECT (value)) + { + arg = GTK_RADIO_ACTION (g_value_get_object (value)); + if (arg) + slist = gtk_radio_action_get_group (arg); + gtk_radio_action_set_group (radio_action, slist); + } + } + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; |