From c25f2c472800541c42be5e9c5956fba9a4ec3196 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 28 Sep 2011 02:28:39 +0200 Subject: [PATCH] testgtk: Convert big windows example from GtkTable to GtkGrid --- tests/testgtk.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/tests/testgtk.c b/tests/testgtk.c index 8a1a6a541e..6a6e18ea01 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -541,7 +541,7 @@ create_big_windows (GtkWidget *widget) { static GtkWidget *window = NULL; GtkWidget *content_area; - GtkWidget *darea, *table, *scrollbar; + GtkWidget *darea, *grid, *scrollbar; GtkWidget *eventbox; GtkAdjustment *hadjustment; GtkAdjustment *vadjustment; @@ -574,8 +574,8 @@ create_big_windows (GtkWidget *widget) content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); - table = gtk_table_new (2, 2, FALSE); - gtk_box_pack_start (GTK_BOX (content_area), table, TRUE, TRUE, 0); + grid = gtk_grid_new (); + gtk_box_pack_start (GTK_BOX (content_area), grid, TRUE, TRUE, 0); darea = gtk_drawing_area_new (); @@ -594,25 +594,19 @@ create_big_windows (GtkWidget *widget) NULL); eventbox = gtk_event_box_new (); - gtk_table_attach (GTK_TABLE (table), eventbox, - 0, 1, 0, 1, - GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, - 0, 0); + gtk_widget_set_hexpand (eventbox, TRUE); + gtk_widget_set_vexpand (eventbox, TRUE); + gtk_grid_attach (GTK_GRID (grid), eventbox, 0, 0, 1, 1); gtk_container_add (GTK_CONTAINER (eventbox), darea); scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, hadjustment); - gtk_table_attach (GTK_TABLE (table), scrollbar, - 0, 1, 1, 2, - GTK_FILL | GTK_EXPAND, GTK_FILL, - 0, 0); + gtk_widget_set_hexpand (scrollbar, TRUE); + gtk_grid_attach (GTK_GRID (grid), scrollbar, 0, 1, 1, 1); scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, vadjustment); - gtk_table_attach (GTK_TABLE (table), scrollbar, - 1, 2, 0, 1, - GTK_FILL, GTK_EXPAND | GTK_FILL, - 0, 0); - + gtk_widget_set_vexpand (scrollbar, TRUE); + gtk_grid_attach (GTK_GRID (grid), scrollbar, 1, 0, 1, 1); } if (!gtk_widget_get_visible (window))