[gtk+] tests: Convert testtreeview from GtkTable to GtkBox
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] tests: Convert testtreeview from GtkTable to GtkBox
- Date: Tue, 27 Sep 2011 03:44:51 +0000 (UTC)
commit b48c2d3aea728379a174719a26dbc0d746c372a6
Author: Benjamin Otte <otte redhat com>
Date: Tue Sep 27 02:53:31 2011 +0200
tests: Convert testtreeview from GtkTable to GtkBox
tests/testtreeview.c | 27 ++++++++++-----------------
1 files changed, 10 insertions(+), 17 deletions(-)
---
diff --git a/tests/testtreeview.c b/tests/testtreeview.c
index 60dc689..cbbe9ab 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]