X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=tests%2Ftestorientable.c;h=d81b612fa0a84944deeb9d54d99d8d477c52d677;hb=HEAD;hp=024816f745e7cec48ce980f1033ff361ff922a29;hpb=05320563495f69497c3af340fc2d31f8794169c2;p=~andy%2Fgtk diff --git a/tests/testorientable.c b/tests/testorientable.c index 024816f74..d81b612fa 100644 --- a/tests/testorientable.c +++ b/tests/testorientable.c @@ -12,9 +12,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #include @@ -49,21 +47,21 @@ int main (int argc, char **argv) { GtkWidget *window; - GtkWidget *table; + GtkWidget *grid; GtkWidget *box, *button; GList *orientables = NULL; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - table = gtk_table_new (2, 3, FALSE); - gtk_table_set_row_spacings (GTK_TABLE (table), 12); - gtk_table_set_col_spacings (GTK_TABLE (table), 12); + grid= gtk_grid_new (); + gtk_grid_set_row_spacing (GTK_GRID (grid), 12); + gtk_grid_set_column_spacing (GTK_GRID (grid), 12); /* GtkBox */ - box = gtk_hbox_new (6, FALSE); + box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); orientables = g_list_prepend (orientables, box); - gtk_table_attach_defaults (GTK_TABLE (table), box, 0, 1, 1, 2); + gtk_grid_attach (GTK_GRID (grid), box, 0, 1, 1, 1); gtk_box_pack_start (GTK_BOX (box), gtk_button_new_with_label ("GtkBox 1"), TRUE, TRUE, 0); @@ -75,9 +73,9 @@ main (int argc, char **argv) TRUE, TRUE, 0); /* GtkButtonBox */ - box = gtk_hbutton_box_new (); + box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); orientables = g_list_prepend (orientables, box); - gtk_table_attach_defaults (GTK_TABLE (table), box, 1, 2, 1, 2); + gtk_grid_attach (GTK_GRID (grid), box, 1, 1, 1, 1); gtk_box_pack_start (GTK_BOX (box), gtk_button_new_with_label ("GtkButtonBox 1"), TRUE, TRUE, 0); @@ -89,17 +87,16 @@ main (int argc, char **argv) TRUE, TRUE, 0); /* GtkSeparator */ - box = gtk_hseparator_new (); + box = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); orientables = g_list_prepend (orientables, box); - gtk_table_attach_defaults (GTK_TABLE (table), box, 2, 3, 1, 2); + gtk_grid_attach (GTK_GRID (grid), box, 2, 1, 1, 1); button = gtk_toggle_button_new_with_label ("Horizontal"); - gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, - GTK_FILL, GTK_FILL, 0, 0); + gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1); g_signal_connect (button, "toggled", G_CALLBACK (orient_toggled), orientables); - gtk_container_add (GTK_CONTAINER (window), table); + gtk_container_add (GTK_CONTAINER (window), grid); gtk_widget_show_all (window); g_signal_connect (window, "destroy",