diff options
author | Benjamin Otte <otte@redhat.com> | 2011-09-27 02:53:31 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-09-27 05:37:14 +0200 |
commit | b48c2d3aea728379a174719a26dbc0d746c372a6 (patch) | |
tree | 864e43a9a7564f656a9803952e8303160d2f5381 | |
parent | dbd49744e35f2c916ec881222469c2ecce8b93a5 (diff) | |
download | gtk+-b48c2d3aea728379a174719a26dbc0d746c372a6.tar.gz |
tests: Convert testtreeview from GtkTable to GtkBox
-rw-r--r-- | tests/testtreeview.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/tests/testtreeview.c b/tests/testtreeview.c index 60dc6891ef..cbbe9abb9d 100644 --- a/tests/testtreeview.c +++ b/tests/testtreeview.c @@ -699,7 +699,7 @@ main (int argc, GtkWidget *window; GtkWidget *sw; GtkWidget *tv; - GtkWidget *table; + GtkWidget *box; GtkWidget *combo_box; GtkTreeModel *model; gint i; @@ -736,9 +736,9 @@ main (int argc, g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); gtk_window_set_default_size (GTK_WINDOW (window), 430, 400); - table = gtk_table_new (3, 1, FALSE); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_container_add (GTK_CONTAINER (window), table); + gtk_container_add (GTK_CONTAINER (window), box); tv = gtk_tree_view_new_with_model (models[0]); @@ -755,14 +755,11 @@ main (int argc, /* Model menu */ combo_box = gtk_combo_box_text_new (); + gtk_widget_set_halign (combo_box, GTK_ALIGN_CENTER); for (i = 0; i < MODEL_LAST; i++) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), model_names[i]); - gtk_table_attach (GTK_TABLE (table), combo_box, - 0, 1, 0, 1, - 0, 0, - 0, 0); - + gtk_container_add (GTK_CONTAINER (box), combo_box); g_signal_connect (combo_box, "changed", G_CALLBACK (model_selected), @@ -770,13 +767,11 @@ main (int argc, /* Columns menu */ combo_box = gtk_combo_box_text_new (); + gtk_widget_set_halign (combo_box, GTK_ALIGN_CENTER); for (i = 0; i < COLUMNS_LAST; i++) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), column_type_names[i]); - gtk_table_attach (GTK_TABLE (table), combo_box, - 0, 1, 1, 2, - 0, 0, - 0, 0); + gtk_container_add (GTK_CONTAINER (box), combo_box); set_columns_type (GTK_TREE_VIEW (tv), COLUMNS_LOTS); gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), COLUMNS_LOTS); @@ -787,15 +782,13 @@ main (int argc, tv); sw = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_hexpand (sw, TRUE); + gtk_widget_set_vexpand (sw, TRUE); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_table_attach (GTK_TABLE (table), sw, - 0, 1, 2, 3, - GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, - 0, 0); + gtk_container_add (GTK_CONTAINER (box), sw); gtk_container_add (GTK_CONTAINER (sw), tv); |