diff options
author | Javier Jardón <jjardon@gnome.org> | 2010-05-24 22:31:36 +0200 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2010-07-13 19:40:47 +0200 |
commit | 4427760bcc330f60ec5778be04274f9f8073a84d (patch) | |
tree | 3ffb76a88d357ea094b1287b1fcfdfe078271f90 /gtk/tests/testing.c | |
parent | 2de1f3f88c661f2b932f9ab36a3b22ca35df1635 (diff) | |
download | gtk+-4427760bcc330f60ec5778be04274f9f8073a84d.tar.gz |
Use GtkBin accessors
Diffstat (limited to 'gtk/tests/testing.c')
-rw-r--r-- | gtk/tests/testing.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gtk/tests/testing.c b/gtk/tests/testing.c index 6208ac6181..c0e75592a5 100644 --- a/gtk/tests/testing.c +++ b/gtk/tests/testing.c @@ -74,9 +74,12 @@ test_button_keys (void) static void test_slider_ranges (void) { + GtkWidget *child; GtkWidget *window = gtk_test_create_simple_window ("Test Window", "Test: gtk_test_warp_slider"); GtkWidget *hscale = gtk_hscale_new_with_range (-50, +50, 5); - gtk_container_add (GTK_CONTAINER (GTK_BIN (window)->child), hscale); + + child = gtk_bin_get_child (GTK_BIN (window)); + gtk_container_add (GTK_CONTAINER (child), hscale); gtk_widget_show (hscale); gtk_widget_show_now (window); while (gtk_events_pending ()) @@ -128,10 +131,13 @@ test_xserver_sync (void) { GtkWidget *window = gtk_test_create_simple_window ("Test Window", "Test: test_xserver_sync"); GtkWidget *darea = gtk_drawing_area_new (); + GtkWidget *child; GTimer *gtimer = g_timer_new(); gint sync_is_slower = 0, repeat = 5; + + child = gtk_bin_get_child (GTK_BIN (window)); gtk_widget_set_size_request (darea, 320, 200); - gtk_container_add (GTK_CONTAINER (GTK_BIN (window)->child), darea); + gtk_container_add (GTK_CONTAINER (child), darea); gtk_widget_show (darea); gtk_widget_show_now (window); while (repeat--) @@ -171,11 +177,14 @@ test_xserver_sync (void) static void test_spin_button_arrows (void) { + GtkWidget *child; GtkWidget *window = gtk_test_create_simple_window ("Test Window", "Test: test_spin_button_arrows"); GtkWidget *spinner = gtk_spin_button_new_with_range (0, 100, 5); gboolean simsuccess; double oldval, newval; - gtk_container_add (GTK_CONTAINER (GTK_BIN (window)->child), spinner); + + child = gtk_bin_get_child (GTK_BIN (window)); + gtk_container_add (GTK_CONTAINER (child), spinner); gtk_widget_show (spinner); gtk_widget_show_now (window); gtk_test_slider_set_perc (spinner, 0); |