Use gtk_scrolled_window_set_child throughout

Replace all uses of gtk_container_add on popovers
by gtk_scrolled_window_set_child.
This commit is contained in:
Matthias Clasen 2020-05-02 00:51:20 -04:00
parent 54b613392b
commit 67759d4c3e
83 changed files with 138 additions and 140 deletions

View File

@ -474,7 +474,7 @@ do_dnd (GtkWidget *do_widget)
box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_add_css_class (box3, "linked");
gtk_container_add (GTK_CONTAINER (sw), box3);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), box3);
for (i = 0; colors[i]; i++)
{

View File

@ -387,7 +387,7 @@ do_editable_cells (GtkWidget *do_widget)
g_object_unref (numbers_model);
g_object_unref (items_model);
gtk_container_add (GTK_CONTAINER (sw), treeview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), treeview);
/* some buttons */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);

View File

@ -78,7 +78,7 @@ do_expander (GtkWidget *do_widget)
"A second paragraph will contain even more "
"innuendo, just to make you scroll down or "
"resize the window. Do it already !", -1);
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
gtk_container_add (GTK_CONTAINER (expander), sw);
gtk_container_add (GTK_CONTAINER (area), expander);
g_signal_connect (expander, "notify::expanded",

View File

@ -134,7 +134,7 @@ create_demo_window (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), sw);
fixed = gtk_fixed_new ();
gtk_container_add (GTK_CONTAINER (sw), fixed);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), fixed);
gtk_widget_set_halign (GTK_WIDGET (fixed), GTK_ALIGN_CENTER);
gtk_widget_set_valign (GTK_WIDGET (fixed), GTK_ALIGN_CENTER);

View File

@ -735,7 +735,7 @@ do_flowbox (GtkWidget *do_widget)
gtk_flow_box_set_max_children_per_line (GTK_FLOW_BOX (flowbox), 30);
gtk_flow_box_set_selection_mode (GTK_FLOW_BOX (flowbox), GTK_SELECTION_NONE);
gtk_container_add (GTK_CONTAINER (scrolled), flowbox);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), flowbox);
gtk_container_add (GTK_CONTAINER (window), scrolled);
for (i = 0; colors[i]; i++)

View File

@ -267,7 +267,7 @@ do_hypertext (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_container_add (GTK_CONTAINER (sw), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), view);
show_page (buffer, 1);
}

View File

@ -66,9 +66,9 @@ populate_icons (void)
hincrement = 0;
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (scrolledwindow), grid);
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwindow), grid);
}
static char *content;
@ -102,9 +102,9 @@ populate_text (gboolean hilight)
hincrement = 0;
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (scrolledwindow), textview);
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwindow), textview);
}
static void
@ -126,9 +126,9 @@ populate_image (void)
hincrement = 5;
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (scrolledwindow), image);
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwindow), image);
}
static void
@ -137,9 +137,8 @@ set_widget_type (int type)
if (tick_cb)
gtk_widget_remove_tick_callback (window, tick_cb);
if (gtk_bin_get_child (GTK_BIN (scrolledwindow)))
gtk_container_remove (GTK_CONTAINER (scrolledwindow),
gtk_bin_get_child (GTK_BIN (scrolledwindow)));
if (gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (scrolledwindow)))
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwindow), NULL);
selected = type;

View File

@ -312,7 +312,7 @@ do_iconview (GtkWidget *do_widget)
/* Connect to the "item-activated" signal */
g_signal_connect (icon_view, "item-activated",
G_CALLBACK (item_activated), store);
gtk_container_add (GTK_CONTAINER (sw), icon_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), icon_view);
gtk_widget_grab_focus (icon_view);
}

View File

@ -289,7 +289,7 @@ do_list_store (GtkWidget *do_widget)
g_object_unref (model);
gtk_container_add (GTK_CONTAINER (sw), treeview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), treeview);
/* add columns to the tree view */
add_columns (GTK_TREE_VIEW (treeview));

View File

@ -368,7 +368,7 @@ do_listbox (GtkWidget *do_widget)
gtk_widget_set_vexpand (scrolled, TRUE);
gtk_container_add (GTK_CONTAINER (vbox), scrolled);
listbox = gtk_list_box_new ();
gtk_container_add (GTK_CONTAINER (scrolled), listbox);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), listbox);
gtk_list_box_set_sort_func (GTK_LIST_BOX (listbox), (GtkListBoxSortFunc)gtk_message_row_sort, listbox, NULL);
gtk_list_box_set_activate_on_single_click (GTK_LIST_BOX (listbox), FALSE);

View File

@ -571,7 +571,7 @@ display_image (const char *resource)
gtk_widget_set_halign (image, GTK_ALIGN_CENTER);
gtk_widget_set_valign (image, GTK_ALIGN_CENTER);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (sw), image);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), image);
return sw;
}
@ -614,7 +614,7 @@ display_text (const char *resource)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (sw), textview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), textview);
return sw;
}

View File

@ -86,7 +86,7 @@ do_markup (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (sw), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), view);
gtk_stack_add_named (GTK_STACK (stack), sw, "formatted");
@ -99,7 +99,7 @@ do_markup (GtkWidget *do_widget)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (sw), view2);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), view2);
gtk_stack_add_named (GTK_STACK (stack), sw, "source");

View File

@ -59,7 +59,7 @@ do_overlay2 (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), overlay);
gtk_container_add (GTK_CONTAINER (overlay), sw);
gtk_container_add (GTK_CONTAINER (sw), text);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), text);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);

View File

@ -424,7 +424,7 @@ do_sliding_puzzle (GtkWidget *do_widget)
gtk_media_stream_play (media);
add_choice (choices, GDK_PAINTABLE (media));
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (sw), choices);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), choices);
gtk_grid_attach (GTK_GRID (tweaks), sw, 0, 0, 2, 1);
label = gtk_label_new ("Size");

View File

@ -47,7 +47,7 @@ do_tabs (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_container_add (GTK_CONTAINER (sw), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), view);
}
if (!gtk_widget_get_visible (window))

View File

@ -159,7 +159,7 @@ create_text_view (GtkWidget *hbox,
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (hbox), swindow);
textview = gtk_text_view_new ();
gtk_container_add (GTK_CONTAINER (swindow), textview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), textview);
timeout = setup_scroll (GTK_TEXT_VIEW (textview), to_end);

View File

@ -54,7 +54,7 @@ do_textundo (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_container_add (GTK_CONTAINER (sw), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), view);
}
if (!gtk_widget_get_visible (window))

View File

@ -503,7 +503,7 @@ do_textview (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC);
gtk_paned_add1 (GTK_PANED (vpaned), sw);
gtk_container_add (GTK_CONTAINER (sw), view1);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), view1);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
@ -511,7 +511,7 @@ do_textview (GtkWidget *do_widget)
GTK_POLICY_AUTOMATIC);
gtk_paned_add2 (GTK_PANED (vpaned), sw);
gtk_container_add (GTK_CONTAINER (sw), view2);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), view2);
create_tags (buffer);
insert_text (GTK_TEXT_VIEW (view1));
@ -595,7 +595,7 @@ easter_egg_callback (GtkWidget *button,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_container_add (GTK_CONTAINER (sw), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), view);
window_ptr = &window;
g_object_add_weak_pointer (G_OBJECT (window), window_ptr);

View File

@ -426,7 +426,7 @@ do_tree_store (GtkWidget *do_widget)
add_columns (GTK_TREE_VIEW (treeview));
gtk_container_add (GTK_CONTAINER (sw), treeview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), treeview);
/* expand all rows after the treeview widget has been realized */
g_signal_connect (treeview, "realize",

View File

@ -551,7 +551,7 @@ example_app_window_open (ExampleAppWindow *win,
view = gtk_text_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_stack_add_titled (GTK_STACK (win->stack), scrolled, basename, basename);
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL))

View File

@ -876,7 +876,7 @@ create_scrolledwindow (void)
GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
label = gtk_label_new ("Scrolled Window");
gtk_container_add (GTK_CONTAINER (scrolledwin), label);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwin), label);
return new_widget_info ("scrolledwindow", scrolledwin, MEDIUM);
}

View File

@ -37,7 +37,7 @@ search_text_changed (GtkEntry *entry,
return;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
view = gtk_bin_get_child (GTK_BIN (tab));
view = gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
/* Very simple-minded search implementation */
@ -77,7 +77,7 @@ update_words (ExampleAppWindow *win)
if (tab == NULL)
return;
view = gtk_bin_get_child (GTK_BIN (tab));
view = gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
strings = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@ -130,7 +130,7 @@ update_lines (ExampleAppWindow *win)
if (tab == NULL)
return;
view = gtk_bin_get_child (GTK_BIN (tab));
view = gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
count = gtk_text_buffer_get_line_count (buffer);
@ -266,7 +266,7 @@ example_app_window_open (ExampleAppWindow *win,
view = gtk_text_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_stack_add_titled (GTK_STACK (win->stack), scrolled, basename, basename);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));

View File

@ -49,7 +49,7 @@ example_app_window_open (ExampleAppWindow *win,
view = gtk_text_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_stack_add_titled (GTK_STACK (win->stack), scrolled, basename, basename);
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL))

View File

@ -49,7 +49,7 @@ example_app_window_open (ExampleAppWindow *win,
view = gtk_text_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_stack_add_titled (GTK_STACK (win->stack), scrolled, basename, basename);
if (g_file_load_contents (file, NULL, &contents, &length, NULL, NULL))

View File

@ -72,7 +72,7 @@ example_app_window_open (ExampleAppWindow *win,
view = gtk_text_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_stack_add_titled (GTK_STACK (win->stack), scrolled, basename, basename);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));

View File

@ -72,7 +72,7 @@ example_app_window_open (ExampleAppWindow *win,
view = gtk_text_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_stack_add_titled (GTK_STACK (win->stack), scrolled, basename, basename);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));

View File

@ -31,7 +31,7 @@ search_text_changed (GtkEntry *entry,
return;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
view = gtk_bin_get_child (GTK_BIN (tab));
view = gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
/* Very simple-minded search implementation */
@ -125,7 +125,7 @@ example_app_window_open (ExampleAppWindow *win,
view = gtk_text_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_stack_add_titled (GTK_STACK (win->stack), scrolled, basename, basename);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));

View File

@ -35,7 +35,7 @@ search_text_changed (GtkEntry *entry,
return;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
view = gtk_bin_get_child (GTK_BIN (tab));
view = gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
/* Very simple-minded search implementation */
@ -75,7 +75,7 @@ update_words (ExampleAppWindow *win)
if (tab == NULL)
return;
view = gtk_bin_get_child (GTK_BIN (tab));
view = gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
strings = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@ -229,7 +229,7 @@ example_app_window_open (ExampleAppWindow *win,
view = gtk_text_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_stack_add_titled (GTK_STACK (win->stack), scrolled, basename, basename);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));

View File

@ -37,7 +37,7 @@ search_text_changed (GtkEntry *entry,
return;
tab = gtk_stack_get_visible_child (GTK_STACK (win->stack));
view = gtk_bin_get_child (GTK_BIN (tab));
view = gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
/* Very simple-minded search implementation */
@ -77,7 +77,7 @@ update_words (ExampleAppWindow *win)
if (tab == NULL)
return;
view = gtk_bin_get_child (GTK_BIN (tab));
view = gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
strings = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@ -130,7 +130,7 @@ update_lines (ExampleAppWindow *win)
if (tab == NULL)
return;
view = gtk_bin_get_child (GTK_BIN (tab));
view = gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (tab));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
count = gtk_text_buffer_get_line_count (buffer);
@ -263,7 +263,7 @@ example_app_window_open (ExampleAppWindow *win,
view = gtk_text_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_stack_add_titled (GTK_STACK (win->stack), scrolled, basename, basename);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));

View File

@ -259,7 +259,7 @@ new_window (GApplication *app,
g_object_set_data ((GObject*)window, "bloatpad-text", view);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_grid_attach (GTK_GRID (grid), scrolled, 0, 1, 1, 1);

View File

@ -92,7 +92,7 @@ new_window (GApplication *app,
g_object_set_data ((GObject*)window, "plugman-text", view);
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_grid_attach (GTK_GRID (grid), scrolled, 0, 0, 1, 1);

View File

@ -26,7 +26,7 @@ new_window (GApplication *app,
gtk_widget_set_vexpand (scrolled, TRUE);
view = gtk_text_view_new ();
gtk_container_add (GTK_CONTAINER (scrolled), view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), view);
gtk_container_add (GTK_CONTAINER (overlay), scrolled);
if (file != NULL)

View File

@ -1045,7 +1045,7 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog)
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
gtk_container_add (GTK_CONTAINER (scrolled), treeview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), treeview);
gtk_widget_show (treeview);
toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);

View File

@ -605,7 +605,8 @@ gtk_entry_completion_constructed (GObject *object)
priv->vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_frame_set_child (GTK_FRAME (popup_frame), priv->vbox);
gtk_container_add (GTK_CONTAINER (priv->scrolled_window), priv->tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (priv->scrolled_window),
priv->tree_view);
gtk_widget_set_hexpand (priv->scrolled_window, TRUE);
gtk_widget_set_vexpand (priv->scrolled_window, TRUE);
gtk_container_add (GTK_CONTAINER (priv->vbox), priv->scrolled_window);

View File

@ -1591,7 +1591,7 @@ create_show_processes_dialog (GtkMountOperation *op,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (scrolled_window), TRUE);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tree_view);
gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
controller = gtk_shortcut_controller_new ();

View File

@ -3810,7 +3810,7 @@ gtk_places_sidebar_init (GtkPlacesSidebar *sidebar)
sidebar->row_placeholder = NULL;
sidebar->dragging_over = FALSE;
gtk_container_add (GTK_CONTAINER (sidebar->swin), sidebar->list_box);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sidebar->swin), sidebar->list_box);
sidebar->hostname = g_strdup (_("Computer"));
sidebar->hostnamed_cancellable = g_cancellable_new ();

View File

@ -972,14 +972,13 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
self,
G_CONNECT_SWAPPED);
scroller = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
NULL);
scroller = gtk_scrolled_window_new (NULL, NULL);
box = g_object_new (GTK_TYPE_BOX,
"halign", GTK_ALIGN_CENTER,
"orientation", GTK_ORIENTATION_VERTICAL,
NULL);
gtk_widget_add_css_class (GTK_WIDGET (box), "shortcuts-search-results");
gtk_container_add (GTK_CONTAINER (scroller), GTK_WIDGET (box));
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scroller), GTK_WIDGET (box));
gtk_stack_add_named (priv->stack, scroller, "internal-search");
priv->search_shortcuts = g_object_new (GTK_TYPE_BOX,

View File

@ -166,7 +166,7 @@ gtk_stack_sidebar_init (GtkStackSidebar *self)
self->list = GTK_LIST_BOX (gtk_list_box_new ());
gtk_container_add (GTK_CONTAINER (sw), GTK_WIDGET (self->list));
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), GTK_WIDGET (self->list));
gtk_list_box_set_header_func (self->list, update_header, self, NULL);

View File

@ -80,7 +80,7 @@ gtk_inspector_controllers_init (GtkInspectorControllers *sl)
"margin-top", 60,
"margin-bottom", 30,
NULL);
gtk_container_add (GTK_CONTAINER (sw), box);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), box);
gtk_widget_set_hexpand (box, TRUE);
gtk_widget_set_vexpand (box, TRUE);

View File

@ -41,6 +41,7 @@
#include "gtkspinbutton.h"
#include "gtksettingsprivate.h"
#include "gtktogglebutton.h"
#include "gtkviewport.h"
#include "gtkwidgetprivate.h"
#include "gtkcssnodeprivate.h"
#include "gtklistbox.h"
@ -574,7 +575,7 @@ flags_changed (GObject *object, GParamSpec *pspec, gpointer data)
popover = gtk_menu_button_get_popover (GTK_MENU_BUTTON (data));
sw = gtk_popover_get_child (GTK_POPOVER (popover));
viewport = gtk_bin_get_child (GTK_BIN (sw));
viewport = gtk_scrolled_window_get_child (GTK_SCROLLED_WINDOW (sw));
box = gtk_viewport_get_child (GTK_VIEWPORT (viewport));
children = gtk_container_get_children (GTK_CONTAINER (box));
@ -957,7 +958,7 @@ property_editor (GObject *object,
NULL);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (box);
gtk_container_add (GTK_CONTAINER (sw), box);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), box);
fclass = G_FLAGS_CLASS (g_type_class_ref (spec->value_type));
@ -1034,7 +1035,7 @@ property_editor (GObject *object,
gtk_list_box_bind_model (GTK_LIST_BOX (box), model, create_row, editor, NULL);
g_object_unref (model);
gtk_container_add (GTK_CONTAINER (sw), box);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), box);
}
else if (type == G_TYPE_PARAM_OBJECT)
{

View File

@ -233,7 +233,7 @@ main (int argc, char *argv[])
extra_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE);
gtk_box_set_spacing (GTK_BOX (extra_hbox), 6);
gtk_container_add (GTK_CONTAINER (scrolled), extra_hbox);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), extra_hbox);
gtk_widget_show (extra_hbox);
bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);

View File

@ -203,7 +203,7 @@ main (int argc, char *argv[])
box = gtk_list_box_new ();
gtk_list_box_bind_model (GTK_LIST_BOX (box), G_LIST_MODEL (store), create_widget, NULL, NULL);
gtk_container_add (GTK_CONTAINER (sw), box);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), box);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
@ -215,7 +215,7 @@ main (int argc, char *argv[])
box = gtk_flow_box_new ();
gtk_flow_box_bind_model (GTK_FLOW_BOX (box), G_LIST_MODEL (store), create_widget, NULL, NULL);
gtk_container_add (GTK_CONTAINER (sw), box);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), box);
button = gtk_button_new_with_label ("Add some");
g_signal_connect (button, "clicked", G_CALLBACK (add_some), store);

View File

@ -83,7 +83,7 @@ main (int argc, char *argv[])
tv = gtk_text_view_new ();
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (tv), GTK_WRAP_WORD);
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (tv)),
content, -1);
g_free (content);

View File

@ -765,7 +765,7 @@ activate (GApplication *app)
contents = gtk_text_view_new ();
gtk_widget_grab_focus (contents);
gtk_container_add (GTK_CONTAINER (sw),
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw),
contents);
/* Create statusbar */

View File

@ -135,7 +135,7 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (window), scrolled_window);
viewport = gtk_viewport_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), viewport);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), viewport);
grid = gtk_grid_new ();
gtk_viewport_set_child (GTK_VIEWPORT (viewport), grid);

View File

@ -35,7 +35,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (box), sw);
tv = gtk_text_view_new ();
fill_text_view (tv, "Left");
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw));
@ -46,7 +46,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (box), sw);
tv = gtk_text_view_new ();
fill_text_view (tv, "Middle");
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
sw = gtk_scrolled_window_new (NULL, adj);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
@ -55,7 +55,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (box), sw);
tv = gtk_text_view_new ();
fill_text_view (tv, "Right");
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
sb = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adj);

View File

@ -79,7 +79,7 @@ key_test (void)
store = gtk_list_store_new (3, G_TYPE_INT, G_TYPE_UINT, G_TYPE_UINT);
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
column = gtk_tree_view_column_new ();
rend = gtk_cell_renderer_accel_new ();
g_object_set (G_OBJECT (rend),

View File

@ -181,7 +181,7 @@ create_tree (gboolean rtl)
treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
gtk_widget_set_direction (treeview, rtl ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
gtk_container_add (GTK_CONTAINER (sw), treeview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), treeview);
/* Line number */

View File

@ -253,7 +253,7 @@ get_formats_list (GdkClipboard *clipboard)
list = gtk_list_box_new ();
g_signal_connect_object (clipboard, "notify::formats", G_CALLBACK (clipboard_formats_change_cb), list, 0);
clipboard_formats_change_cb (clipboard, NULL, list);
gtk_container_add (GTK_CONTAINER (sw), list);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), list);
return sw;
}

View File

@ -274,13 +274,13 @@ main (int argc, char **argv)
gtk_widget_set_hexpand (scrolled_window, TRUE);
gtk_container_add (GTK_CONTAINER (hbox), scrolled_window);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
text_view = gtk_text_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (text_view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), text_view);
button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_container_add (GTK_CONTAINER (hbox), button_vbox);

View File

@ -301,7 +301,7 @@ int main (int argc, char *argv[])
box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_add_css_class (box3, "linked");
gtk_container_add (GTK_CONTAINER (sw), box3);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), box3);
for (i = 0; colors[i]; i++)
{

View File

@ -68,7 +68,7 @@ main (int argc, char *argv[])
"A second paragraph will contain even more "
"innuendo, just to make you scroll down or "
"resize the window. Do it already !", -1);
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
gtk_container_add (GTK_CONTAINER (expander), sw);
gtk_widget_set_hexpand (expander, TRUE);
gtk_widget_set_vexpand (expander, TRUE);

View File

@ -407,7 +407,7 @@ create_window (void)
gtk_flow_box_set_min_children_per_line (GTK_FLOW_BOX (flowbox), INITIAL_MINIMUM_LENGTH);
gtk_flow_box_set_max_children_per_line (GTK_FLOW_BOX (flowbox), INITIAL_MAXIMUM_LENGTH);
gtk_widget_show (flowbox);
gtk_container_add (GTK_CONTAINER (swindow), flowbox);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), flowbox);
gtk_flow_box_set_hadjustment (GTK_FLOW_BOX (flowbox),
gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (swindow)));

View File

@ -263,7 +263,7 @@ scrolling (void)
grid = gtk_grid_new ();
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_container_add (GTK_CONTAINER (sw), viewport);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), viewport);
gtk_viewport_set_child (GTK_VIEWPORT (viewport), grid);
child = oriented_test_widget ("#800080", "#800080");

View File

@ -129,7 +129,7 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (window), sw);
tv = gtk_tree_view_new_with_model (model);
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
g_signal_connect (tv, "row-activated",
G_CALLBACK (tree_view_row_activated), tv);

View File

@ -1548,7 +1548,7 @@ create_listbox (GtkWidget *widget)
gtk_container_add (GTK_CONTAINER (hbox), scrolled);
scrolled_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (scrolled), scrolled_box);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), scrolled_box);
label = gtk_label_new ("This is \na LABEL\nwith rows");
gtk_container_add (GTK_CONTAINER (scrolled_box), label);
@ -1882,7 +1882,7 @@ scrolled_windows_delete_cb (GtkWidget *widget,
{
g_object_ref (scrollwin);
gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (scrollwin)), scrollwin);
gtk_container_add (GTK_CONTAINER (sw_parent), scrollwin);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw_parent), scrollwin);
g_object_unref (scrollwin);
g_signal_handler_disconnect (sw_parent, sw_destroyed_handler);
@ -1916,7 +1916,7 @@ scrolled_windows_remove (GtkWidget *dialog, gint response, GtkWidget *scrollwin)
{
g_object_ref (scrollwin);
gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (scrollwin)), scrollwin);
gtk_container_add (GTK_CONTAINER (sw_parent), scrollwin);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw_parent), scrollwin);
g_object_unref (scrollwin);
@ -1938,7 +1938,7 @@ scrolled_windows_remove (GtkWidget *dialog, gint response, GtkWidget *scrollwin)
g_object_ref (scrollwin);
gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (scrollwin)), scrollwin);
gtk_container_add (GTK_CONTAINER (sw_float_parent), scrollwin);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw_float_parent), scrollwin);
g_object_unref (scrollwin);
@ -1990,7 +1990,7 @@ create_scrolled_windows (GtkWidget *widget)
grid = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (grid), 10);
gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
gtk_container_add (GTK_CONTAINER (scrolled_window), grid);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), grid);
gtk_viewport_set_scroll_to_focus (GTK_VIEWPORT (gtk_widget_get_parent (grid)), TRUE);
gtk_widget_show (grid);
@ -6070,7 +6070,7 @@ create_main_window (void)
gtk_container_add (GTK_CONTAINER (box1), scrolled_window);
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (scrolled_window), box2);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), box2);
gtk_viewport_set_scroll_to_focus (GTK_VIEWPORT (gtk_widget_get_parent (box2)), TRUE);
gtk_widget_show (box2);

View File

@ -520,16 +520,16 @@ main (gint argc, gchar **argv)
targets,
GDK_ACTION_MOVE);
gdk_content_formats_unref (targets);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), icon_list);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), icon_list);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_paned_add1 (GTK_PANED (paned), scrolled_window);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tv);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@ -578,9 +578,9 @@ main (gint argc, gchar **argv)
icon_list = gtk_icon_view_new ();
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), icon_list);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), icon_list);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_paned_add2 (GTK_PANED (paned), scrolled_window);
gtk_widget_show (window);

View File

@ -71,7 +71,7 @@ kinetic_scrolling (void)
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_kinetic_scrolling (GTK_SCROLLED_WINDOW (swindow), TRUE);
gtk_scrolled_window_set_capture_button_press (GTK_SCROLLED_WINDOW (swindow), TRUE);
gtk_container_add (GTK_CONTAINER (swindow), button_grid);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), button_grid);
gtk_widget_show (button_grid);
gtk_grid_attach (GTK_GRID (grid), swindow, 0, 1, 1, 1);
@ -111,7 +111,7 @@ kinetic_scrolling (void)
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_kinetic_scrolling (GTK_SCROLLED_WINDOW (swindow), TRUE);
gtk_scrolled_window_set_capture_button_press (GTK_SCROLLED_WINDOW (swindow), TRUE);
gtk_container_add (GTK_CONTAINER (swindow), treeview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), treeview);
gtk_widget_show (treeview);
gtk_grid_attach (GTK_GRID (grid), swindow, 1, 1, 1, 1);
@ -123,7 +123,7 @@ kinetic_scrolling (void)
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_kinetic_scrolling (GTK_SCROLLED_WINDOW (swindow), TRUE);
gtk_scrolled_window_set_capture_button_press (GTK_SCROLLED_WINDOW (swindow), TRUE);
gtk_container_add (GTK_CONTAINER (swindow), textview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), textview);
gtk_widget_show (textview);
gtk_grid_attach (GTK_GRID (grid), swindow, 2, 1, 1, 1);

View File

@ -290,7 +290,7 @@ main (int argc, char *argv[])
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (scrolled), list);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled), list);
gtk_container_add (GTK_CONTAINER (hbox), scrolled);
g_signal_connect (list, "row-activated", G_CALLBACK (row_activated_cb), NULL);

View File

@ -123,7 +123,7 @@ int main (int argc, char *argv[])
gtk_list_box_set_header_func (GTK_LIST_BOX (list), add_separator, NULL, NULL);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_container_add (GTK_CONTAINER (sw), list);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), list);
for (i = 0; i < 20; i++)
{

View File

@ -158,7 +158,7 @@ main (int argc, char *argv[])
gtk_widget_set_hexpand (sw, TRUE);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
gtk_container_add (GTK_CONTAINER (hbox), sw);
gtk_container_add (GTK_CONTAINER (sw), list);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), list);
button = gtk_check_button_new_with_label ("Activate on single click");
g_object_bind_property (list, "activate-on-single-click",

View File

@ -110,7 +110,7 @@ new_window (GApplication *app)
list = gtk_list_box_new ();
gtk_list_box_set_selection_mode (GTK_LIST_BOX (list), GTK_SELECTION_NONE);
gtk_list_box_set_header_func (GTK_LIST_BOX (list), add_separator, NULL, NULL);
gtk_container_add (GTK_CONTAINER (sw), list);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), list);
label = gtk_label_new ("No row activated");
gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);

View File

@ -247,7 +247,7 @@ test_scrolling (void)
gtk_widget_set_hexpand (text, TRUE);
gtk_widget_set_vexpand (text, TRUE);
gtk_container_add (GTK_CONTAINER (sw), text);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), text);
child = gtk_label_new ("This should be visible");
gtk_widget_set_halign (child, GTK_ALIGN_CENTER);
@ -393,7 +393,7 @@ test_chase (void)
gtk_widget_set_hexpand (text, TRUE);
gtk_widget_set_vexpand (text, TRUE);
gtk_container_add (GTK_CONTAINER (sw), text);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), text);
child = gtk_label_new ("Try to enter");
gtk_widget_set_halign (child, GTK_ALIGN_START);

View File

@ -77,7 +77,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (overlay), sw);
main_child = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (sw), main_child);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), main_child);
gtk_widget_set_hexpand (main_child, TRUE);
gtk_widget_set_vexpand (main_child, TRUE);
label = gtk_label_new ("Main child");

View File

@ -127,7 +127,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (win), overlay);
gtk_container_add (GTK_CONTAINER (overlay), sw);
gtk_container_add (GTK_CONTAINER (sw), list);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), list);
populate_list (GTK_LIST_BOX (list));
g_signal_connect (sw, "edge-overshot", G_CALLBACK (edge_overshot), list);

View File

@ -119,7 +119,7 @@ scrollable_policy (void)
gtk_widget_show (label);
gtk_widget_show (viewport);
gtk_viewport_set_child (GTK_VIEWPORT (viewport), label);
gtk_container_add (GTK_CONTAINER (swindow), viewport);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), viewport);
/* Add controls here */
expander = gtk_expander_new ("Controls");
@ -232,7 +232,7 @@ scrollable_policy (void)
/* Listbox */
listbox = gtk_list_box_new ();
gtk_container_add (GTK_CONTAINER (swindow), listbox);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), listbox);
gtk_widget_show (listbox);
/* Min content */

View File

@ -15,7 +15,7 @@ int main (int argc, char *argv[])
viewport = gtk_viewport_new (gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (sw)),
gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw)));
gtk_viewport_set_scroll_to_focus (GTK_VIEWPORT (viewport), TRUE);
gtk_container_add (GTK_CONTAINER (sw), viewport);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), viewport);
grid = gtk_grid_new ();
gtk_widget_set_margin_start (grid, 20);
gtk_widget_set_margin_end (grid, 20);

View File

@ -177,7 +177,7 @@ main (gint argc,
tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
gtk_container_add (GTK_CONTAINER (scrolled_win), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_win), tree_view);
w3 = scrolled_win;
renderer = gtk_cell_renderer_text_new ();

View File

@ -193,7 +193,7 @@ main (int argc, char **argv)
anchor = insert_text (buffer);
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_container_add (GTK_CONTAINER (sw), textview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), textview);
gtk_text_view_add_overlay (GTK_TEXT_VIEW (textview),
button,
50, 150);

View File

@ -203,7 +203,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (box), sw);
tv = gtk_text_view_new ();
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
buffer = gtk_text_buffer_new (NULL);
gtk_text_view_set_buffer (GTK_TEXT_VIEW (tv), buffer);

View File

@ -515,7 +515,7 @@ main (int argc,
NULL);
for (i = 0; i < (MIN_ROWS + MAX_ROWS) / 2; i++)
add (GTK_TREE_VIEW (treeview));
gtk_container_add (GTK_CONTAINER (sw), treeview);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), treeview);
gtk_widget_show (window);

View File

@ -763,7 +763,7 @@ main (int argc, char *argv[])
gtk_window_set_title (GTK_WINDOW (window), "Top Window");
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (window), swindow);
gtk_container_add (GTK_CONTAINER (swindow), sample_tree_view_top);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), sample_tree_view_top);
gtk_widget_show (window);
window = gtk_window_new ();
@ -772,7 +772,7 @@ main (int argc, char *argv[])
gtk_window_set_title (GTK_WINDOW (window), "Bottom Window");
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (window), swindow);
gtk_container_add (GTK_CONTAINER (swindow), sample_tree_view_bottom);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), sample_tree_view_bottom);
gtk_widget_show (window);
/* Set up the main window */
@ -791,7 +791,7 @@ main (int argc, char *argv[])
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
left_tree_view = gtk_tree_view_new_with_model (left_tree_model);
gtk_container_add (GTK_CONTAINER (swindow), left_tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), left_tree_view);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (left_tree_view), -1,
"Unattached Columns", cell, "text", 0, NULL);
cell = gtk_cell_renderer_toggle_new ();
@ -857,7 +857,7 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_cell_data_func (column, cell, get_visible, NULL, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (top_right_tree_view), column);
gtk_container_add (GTK_CONTAINER (swindow), top_right_tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), top_right_tree_view);
gtk_container_add (GTK_CONTAINER (vbox2), swindow);
swindow = gtk_scrolled_window_new (NULL, NULL);
@ -871,7 +871,7 @@ main (int argc, char *argv[])
column = gtk_tree_view_column_new_with_attributes (NULL, cell, NULL);
gtk_tree_view_column_set_cell_data_func (column, cell, get_visible, NULL, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (bottom_right_tree_view), column);
gtk_container_add (GTK_CONTAINER (swindow), bottom_right_tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (swindow), bottom_right_tree_view);
gtk_container_add (GTK_CONTAINER (vbox2), swindow);

View File

@ -213,7 +213,7 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (vbox), sw);
tree_view = gtk_tree_view_new_with_model (create_model ());
gtk_container_add (GTK_CONTAINER (sw), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tree_view);
for (i = 0; i < 5; i++)
{

View File

@ -358,7 +358,7 @@ main (gint argc, gchar **argv)
"value", PROGRESS_COLUMN,
NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tree_view);
gtk_window_set_default_size (GTK_WINDOW (window),
800, 250);

View File

@ -169,7 +169,7 @@ main (int argc, char *argv[])
gtk_cell_renderer_text_new (),
"text", TEXT_COLUMN,
NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tree_view);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
button = gtk_button_new_with_mnemonic ("<b>_Futz!!</b>");

View File

@ -466,7 +466,7 @@ main (int argc, char *argv[])
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tree_view);
g_signal_connect (tree_view, "realize",
G_CALLBACK (gtk_tree_view_expand_all),
@ -536,8 +536,7 @@ main (int argc, char *argv[])
G_CALLBACK (gtk_tree_view_expand_all),
NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tree_view);
gtk_window_set_default_size (GTK_WINDOW (window),
650, 400);

View File

@ -97,7 +97,7 @@ int main (int argc, char *argv[])
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (window), sw);
tv = gtk_tree_view_new ();
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
col = gtk_tree_view_column_new ();
cell = gtk_cell_renderer_text_new ();

View File

@ -235,7 +235,7 @@ main (int argc, char *argv[])
WORD_COLUMN_1,
GTK_SORT_ASCENDING);*/
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tree_view);
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
gtk_widget_show (window);
@ -299,9 +299,8 @@ main (int argc, char *argv[])
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (smodel),
WORD_COLUMN_1,
GTK_SORT_DESCENDING);*/
gtk_container_add (GTK_CONTAINER (scrolled_window2), tree_view2);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window2), tree_view2);
gtk_window_set_default_size (GTK_WINDOW (window2), 400, 400);
gtk_widget_show (window2);
}
@ -367,8 +366,8 @@ main (int argc, char *argv[])
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (ssmodel),
WORD_COLUMN_1,
GTK_SORT_ASCENDING);*/
gtk_container_add (GTK_CONTAINER (scrolled_window3), tree_view3);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window3), tree_view3);
gtk_window_set_default_size (GTK_WINDOW (window3), 400, 400);
gtk_widget_show (window3);
}

View File

@ -755,7 +755,7 @@ main (int argc,
gtk_container_add (GTK_CONTAINER (box), sw);
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
gtk_widget_show (window);

View File

@ -377,8 +377,8 @@ main (gint argc, gchar **argv)
gtk_tree_view_expand_all (GTK_TREE_VIEW (tree_view));
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tree_view);
gtk_window_set_default_size (GTK_WINDOW (window),
800, 400);

View File

@ -342,7 +342,7 @@ make_window (gint view_type)
gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection), GTK_SELECTION_SINGLE);
/* Put them together */
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolled_window), tree_view);
gtk_widget_set_vexpand (scrolled_window, TRUE);
gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
gtk_container_add (GTK_CONTAINER (window), vbox);

View File

@ -40,7 +40,7 @@ test_scrolled_window_child_count (void)
g_object_ref_sink (sw);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);
gtk_container_add (GTK_CONTAINER (sw), gtk_label_new ("Bla"));
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), gtk_label_new ("Bla"));
accessible = gtk_widget_get_accessible (sw);
g_assert_cmpint (atk_object_get_n_accessible_children (accessible), ==, 3);

View File

@ -29,7 +29,7 @@ test_size (gboolean overlay,
gtk_scrolled_window_set_propagate_natural_height (GTK_SCROLLED_WINDOW (scrolledwindow), TRUE);
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (scrolledwindow), overlay);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), policy, policy);
gtk_container_add (GTK_CONTAINER (scrolledwindow), box);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrolledwindow), box);
/* Testing the content-width property */
if (orientation == GTK_ORIENTATION_HORIZONTAL)