summaryrefslogtreecommitdiff
path: root/tests/testgtk.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-11-05 14:21:24 +0100
committerAlexander Larsson <alexl@redhat.com>2010-11-05 14:25:12 +0100
commit5f62ba26930c64e358e9e917836d56d7269eeb8a (patch)
treed27bc419a81965ab38562af72038b435e728d9a5 /tests/testgtk.c
parentf03481c4f296b96b269ca986ec6729640fbb8f88 (diff)
downloadgtk+-radio-group.tar.gz
Convert the "group" property on radio widgets to a GtkRadioGroupradio-group
The various radio widgets all have a write-only "group" property of the same type as the widget. This let you set the group in a bindable way, but is quite weird when we have a real GtkRadioGroup object. We convert this to a real read-write GtkRadioGroup type. Additionally we make it CONSTRUCT and use it in the various constructors instead of hand-rolling the set_group call.
Diffstat (limited to 'tests/testgtk.c')
-rw-r--r--tests/testgtk.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 9f4e1d586e..1d9131b87c 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -858,9 +858,9 @@ static GtkWidget *
create_widget_grid (GType widget_type)
{
GtkWidget *table;
- GtkWidget *group_widget = NULL;
+ GtkRadioGroup *group = NULL;
gint i, j;
-
+
table = gtk_table_new (FALSE, 3, 3);
for (i = 0; i < 5; i++)
@@ -892,10 +892,9 @@ create_widget_grid (GType widget_type)
if (g_type_is_a (widget_type, GTK_TYPE_RADIO_BUTTON))
{
- if (!group_widget)
- group_widget = widget;
- else
- g_object_set (widget, "group", group_widget, NULL);
+ if (!group)
+ group = gtk_radio_group_new ();
+ g_object_set (widget, "group", group, NULL);
}
}