diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-05-02 17:26:54 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-04 22:53:08 -0400 |
commit | f59f3551902268600090c0382068103a09184df0 (patch) | |
tree | aa006e0f33df61b714d68d2931f7a3bc64933fac /examples | |
parent | b9b1bf85e19fb31fcff2ab6b0dce8d0fffea7e01 (diff) | |
download | gtk+-f59f3551902268600090c0382068103a09184df0.tar.gz |
Use gtk_window_set_child throughout
Replace all uses of gtk_container_add on windows
by gtk_window_set_child.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/action-namespace.c | 2 | ||||
-rw-r--r-- | examples/bp/bloatpad.c | 2 | ||||
-rw-r--r-- | examples/drawing.c | 2 | ||||
-rw-r--r-- | examples/grid-packing.c | 2 | ||||
-rw-r--r-- | examples/hello-world.c | 2 | ||||
-rw-r--r-- | examples/plugman.c | 2 | ||||
-rw-r--r-- | examples/search-bar.c | 2 | ||||
-rw-r--r-- | examples/sunny.c | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/examples/action-namespace.c b/examples/action-namespace.c index da18e7828b..642b7c8fca 100644 --- a/examples/action-namespace.c +++ b/examples/action-namespace.c @@ -113,7 +113,7 @@ activate (GApplication *app, gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), G_MENU_MODEL (button_menu)); gtk_widget_set_halign (GTK_WIDGET (button), GTK_ALIGN_CENTER); gtk_widget_set_valign (GTK_WIDGET (button), GTK_ALIGN_START); - gtk_container_add (GTK_CONTAINER (win), button); + gtk_window_set_child (GTK_WINDOW (window), button); gtk_widget_show (win); g_object_unref (button_menu); diff --git a/examples/bp/bloatpad.c b/examples/bp/bloatpad.c index 3cb619eb8f..be6bee5aa6 100644 --- a/examples/bp/bloatpad.c +++ b/examples/bp/bloatpad.c @@ -222,7 +222,7 @@ new_window (GApplication *app, gtk_window_set_title (GTK_WINDOW (window), "Bloatpad"); grid = gtk_grid_new (); - gtk_container_add (GTK_CONTAINER (window), grid); + gtk_window_set_child (GTK_WINDOW (window), grid); toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); button = gtk_toggle_button_new (); diff --git a/examples/drawing.c b/examples/drawing.c index e00460889f..be45149e5c 100644 --- a/examples/drawing.c +++ b/examples/drawing.c @@ -143,7 +143,7 @@ activate (GtkApplication *app, g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL); frame = gtk_frame_new (NULL); - gtk_container_add (GTK_CONTAINER (window), frame); + gtk_window_set_child (GTK_WINDOW (window), frame); drawing_area = gtk_drawing_area_new (); /* set a minimum size */ diff --git a/examples/grid-packing.c b/examples/grid-packing.c index b6cb0ba334..dcee10f712 100644 --- a/examples/grid-packing.c +++ b/examples/grid-packing.c @@ -23,7 +23,7 @@ activate (GtkApplication *app, grid = gtk_grid_new (); /* Pack the container in the window */ - gtk_container_add (GTK_CONTAINER (window), grid); + gtk_window_set_child (GTK_WINDOW (window), grid); button = gtk_button_new_with_label ("Button 1"); g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL); diff --git a/examples/hello-world.c b/examples/hello-world.c index 4005d66ca9..ebafc735c6 100644 --- a/examples/hello-world.c +++ b/examples/hello-world.c @@ -20,7 +20,7 @@ activate (GtkApplication *app, gtk_window_set_default_size (GTK_WINDOW (window), 200, 200); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); - gtk_container_add (GTK_CONTAINER (window), box); + gtk_window_set_child (GTK_WINDOW (window), box); button = gtk_button_new_with_label ("Hello World"); g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL); diff --git a/examples/plugman.c b/examples/plugman.c index 1b33f0eeb4..752e2b9649 100644 --- a/examples/plugman.c +++ b/examples/plugman.c @@ -83,7 +83,7 @@ new_window (GApplication *app, gtk_window_set_title (GTK_WINDOW (window), "Plugman"); grid = gtk_grid_new (); - gtk_container_add (GTK_CONTAINER (window), grid); + gtk_window_set_child (GTK_WINDOW (window), grid); scrolled = gtk_scrolled_window_new (NULL, NULL); gtk_widget_set_hexpand (scrolled, TRUE); diff --git a/examples/search-bar.c b/examples/search-bar.c index 0a42a925ce..1657b2b874 100644 --- a/examples/search-bar.c +++ b/examples/search-bar.c @@ -15,7 +15,7 @@ activate_cb (GtkApplication *app, search_bar = gtk_search_bar_new (); gtk_widget_set_valign (search_bar, GTK_ALIGN_START); - gtk_container_add (GTK_CONTAINER (window), search_bar); + gtk_window_set_child (GTK_WINDOW (window), search_bar); gtk_widget_show (search_bar); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); diff --git a/examples/sunny.c b/examples/sunny.c index 86d4d73fc0..bd67831451 100644 --- a/examples/sunny.c +++ b/examples/sunny.c @@ -19,7 +19,7 @@ new_window (GApplication *app, gtk_window_set_titlebar (GTK_WINDOW (window), header); overlay = gtk_overlay_new (); - gtk_container_add (GTK_CONTAINER (window), overlay); + gtk_window_set_child (GTK_WINDOW (window), overlay); scrolled = gtk_scrolled_window_new (NULL, NULL); gtk_widget_set_hexpand (scrolled, TRUE); |