tests: Convert testtreeview from GtkTable to GtkBox

This commit is contained in:
Benjamin Otte 2011-09-27 02:53:31 +02:00
parent dbd49744e3
commit b48c2d3aea

View File

@ -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);