diff options
author | Benjamin Otte <otte@redhat.com> | 2011-09-27 04:02:52 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-09-27 05:37:14 +0200 |
commit | 7724f14dfa7545cfb9f7a13cd0f2aa6a41018157 (patch) | |
tree | 699ae530209916942bc98e5a986b6fc37ba6a50c | |
parent | b48c2d3aea728379a174719a26dbc0d746c372a6 (diff) | |
download | gtk+-7724f14dfa7545cfb9f7a13cd0f2aa6a41018157.tar.gz |
tests: Convert testtoolbar to use a box instead of a table
-rw-r--r-- | tests/testtoolbar.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/tests/testtoolbar.c b/tests/testtoolbar.c index 38056cd1cd..16d847a853 100644 --- a/tests/testtoolbar.c +++ b/tests/testtoolbar.c @@ -485,7 +485,7 @@ timeout_cb1 (GtkWidget *widget) gint main (gint argc, gchar **argv) { - GtkWidget *window, *toolbar, *table, *treeview, *scrolled_window; + GtkWidget *window, *toolbar, *vbox, *treeview, *scrolled_window; GtkWidget *hbox, *hbox1, *hbox2, *checkbox, *option_menu, *menu; gint i; static const gchar *toolbar_styles[] = { "icons", "text", "both (vertical)", @@ -505,22 +505,19 @@ main (gint argc, gchar **argv) g_signal_connect (window, "destroy", G_CALLBACK(gtk_main_quit), NULL); - table = gtk_table_new (4, 2, FALSE); - gtk_container_add (GTK_CONTAINER (window), table); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_container_add (GTK_CONTAINER (window), vbox); toolbar = gtk_toolbar_new (); - gtk_table_attach (GTK_TABLE (table), toolbar, - 0,2, 0,1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0); + gtk_container_add (GTK_CONTAINER (vbox), toolbar); hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3); gtk_container_set_border_width (GTK_CONTAINER (hbox1), 5); - gtk_table_attach (GTK_TABLE (table), hbox1, - 1,2, 1,2, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0); + gtk_container_add (GTK_CONTAINER (vbox), hbox1); hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); gtk_container_set_border_width (GTK_CONTAINER (hbox2), 5); - gtk_table_attach (GTK_TABLE (table), hbox2, - 1,2, 2,3, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0); + gtk_container_add (GTK_CONTAINER (vbox), hbox2); checkbox = gtk_check_button_new_with_mnemonic("_Vertical"); gtk_box_pack_start (GTK_BOX (hbox1), checkbox, FALSE, FALSE, 0); @@ -566,8 +563,8 @@ main (gint argc, gchar **argv) scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_table_attach (GTK_TABLE (table), scrolled_window, - 1,2, 3,4, GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0); + gtk_widget_set_vexpand (scrolled_window, TRUE); + gtk_container_add (GTK_CONTAINER (vbox), scrolled_window); store = create_items_list (&treeview); gtk_container_add (GTK_CONTAINER (scrolled_window), treeview); @@ -685,8 +682,7 @@ main (gint argc, gchar **argv) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); - gtk_table_attach (GTK_TABLE (table), hbox, - 1,2, 4,5, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0); + gtk_container_add (GTK_CONTAINER (vbox), hbox); button = gtk_button_new_with_label ("Drag me to the toolbar"); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); |