diff options
author | Benjamin Otte <otte@redhat.com> | 2011-09-29 00:41:35 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-09-29 01:51:46 +0200 |
commit | 9aed1514b7ed928b2c4c55f7aa59c8e1618cd3d1 (patch) | |
tree | 4ca8a9b7cb8c8627531d25dace5b977fbd864b38 /tests/testgtk.c | |
parent | 4fbda7abfbc19ee07d941de20a66306549ab2300 (diff) | |
download | gtk+-9aed1514b7ed928b2c4c55f7aa59c8e1618cd3d1.tar.gz |
testgtk: Convert panes example from GtkTable to GtkGrid
Diffstat (limited to 'tests/testgtk.c')
-rw-r--r-- | tests/testgtk.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c index 61fa5a47a2..6bd66a889f 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -6310,7 +6310,7 @@ create_pane_options (GtkPaned *paned, { GtkWidget *child1, *child2; GtkWidget *frame; - GtkWidget *table; + GtkWidget *grid; GtkWidget *label; GtkWidget *button; GtkWidget *check_button; @@ -6321,23 +6321,20 @@ create_pane_options (GtkPaned *paned, frame = gtk_frame_new (frame_label); gtk_container_set_border_width (GTK_CONTAINER (frame), 4); - table = gtk_table_new (4, 2, 4); - gtk_container_add (GTK_CONTAINER (frame), table); + grid = gtk_grid_new (); + gtk_container_add (GTK_CONTAINER (frame), grid); label = gtk_label_new (label1); - gtk_table_attach_defaults (GTK_TABLE (table), label, - 0, 1, 0, 1); + gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1); check_button = gtk_check_button_new_with_label ("Resize"); - gtk_table_attach_defaults (GTK_TABLE (table), check_button, - 0, 1, 1, 2); + gtk_grid_attach (GTK_GRID (grid), check_button, 0, 1, 1, 1); g_signal_connect (check_button, "toggled", G_CALLBACK (toggle_resize), child1); check_button = gtk_check_button_new_with_label ("Shrink"); - gtk_table_attach_defaults (GTK_TABLE (table), check_button, - 0, 1, 2, 3); + gtk_grid_attach (GTK_GRID (grid), check_button, 0, 2, 1, 1); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE); g_signal_connect (check_button, "toggled", @@ -6345,12 +6342,10 @@ create_pane_options (GtkPaned *paned, child1); label = gtk_label_new (label2); - gtk_table_attach_defaults (GTK_TABLE (table), label, - 1, 2, 0, 1); + gtk_grid_attach (GTK_GRID (grid), label, 1, 0, 1, 1); check_button = gtk_check_button_new_with_label ("Resize"); - gtk_table_attach_defaults (GTK_TABLE (table), check_button, - 1, 2, 1, 2); + gtk_grid_attach (GTK_GRID (grid), check_button, 1, 1, 1, 1); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE); g_signal_connect (check_button, "toggled", @@ -6358,8 +6353,7 @@ create_pane_options (GtkPaned *paned, child2); check_button = gtk_check_button_new_with_label ("Shrink"); - gtk_table_attach_defaults (GTK_TABLE (table), check_button, - 1, 2, 2, 3); + gtk_grid_attach (GTK_GRID (grid), check_button, 1, 2, 1, 1); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE); g_signal_connect (check_button, "toggled", @@ -6367,8 +6361,7 @@ create_pane_options (GtkPaned *paned, child2); button = gtk_button_new_with_mnemonic ("_Properties"); - gtk_table_attach_defaults (GTK_TABLE (table), button, - 0, 2, 3, 4); + gtk_grid_attach (GTK_GRID (grid), button, 0, 3, 2, 1); g_signal_connect (button, "clicked", G_CALLBACK (paned_props_clicked), paned); |