[gtk/bin-removal: 21/40] Use gtk_search_bar_set_child throughout



commit 99ef14b59fde5bfb2dbfdb0f1b7fe49b8550ddf5
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun May 3 09:58:27 2020 -0400

    Use gtk_search_bar_set_child throughout

 demos/gtk-demo/search_entry2.c | 2 +-
 examples/search-bar.c          | 2 +-
 gtk/gtkshortcutswindow.c       | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/demos/gtk-demo/search_entry2.c b/demos/gtk-demo/search_entry2.c
index de8c577b91..5e8cb6ac8b 100644
--- a/demos/gtk-demo/search_entry2.c
+++ b/demos/gtk-demo/search_entry2.c
@@ -87,7 +87,7 @@ do_search_entry2 (GtkWidget *do_widget)
       searchbar = gtk_search_bar_new ();
       gtk_search_bar_connect_entry (GTK_SEARCH_BAR (searchbar), GTK_EDITABLE (entry));
       gtk_search_bar_set_show_close_button (GTK_SEARCH_BAR (searchbar), FALSE);
-      gtk_container_add (GTK_CONTAINER (searchbar), container);
+      gtk_search_bar_set_child (GTK_SEARCH_BAR (searchbar), container);
       gtk_container_add (GTK_CONTAINER (vbox), searchbar);
 
       /* Hook the search bar to key presses */
diff --git a/examples/search-bar.c b/examples/search-bar.c
index 1657b2b874..c39dc8c140 100644
--- a/examples/search-bar.c
+++ b/examples/search-bar.c
@@ -19,7 +19,7 @@ activate_cb (GtkApplication *app,
   gtk_widget_show (search_bar);
 
   box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-  gtk_container_add (GTK_CONTAINER (search_bar), box);
+  gtk_search_bar_set_child (GTK_SEARCH_BAR (search_bar), box);
 
   entry = gtk_search_entry_new ();
   gtk_widget_set_hexpand (entry, TRUE);
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index 60ed0cca53..93d3b40bff 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -910,7 +910,8 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
   gtk_popover_set_child (GTK_POPOVER (priv->popover), GTK_WIDGET (priv->list_box));
 
   priv->search_entry = GTK_SEARCH_ENTRY (gtk_search_entry_new ());
-  gtk_container_add (GTK_CONTAINER (priv->search_bar), GTK_WIDGET (priv->search_entry));
+  gtk_search_bar_set_child (GTK_SEARCH_BAR (priv->search_bar), GTK_WIDGET (priv->search_entry));
+
   g_object_set (priv->search_entry,
                 /* Translators: This is placeholder text for the search entry in the shortcuts window */
                 "placeholder-text", _("Search Shortcuts"),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]