summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-05-02 00:51:20 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-05-04 22:53:07 -0400
commit67759d4c3ee28bbff9a4ec17f2044822ba732282 (patch)
tree96f80ce99c575bb0ad3c0560cf117e89dd1059b5 /examples
parent54b613392bb630108340259c84baac4d518fb444 (diff)
downloadgtk+-67759d4c3ee28bbff9a4ec17f2044822ba732282.tar.gz
Use gtk_scrolled_window_set_child throughout
Replace all uses of gtk_container_add on popovers by gtk_scrolled_window_set_child.
Diffstat (limited to 'examples')
-rw-r--r--examples/application10/exampleappwin.c8
-rw-r--r--examples/application3/exampleappwin.c2
-rw-r--r--examples/application4/exampleappwin.c2
-rw-r--r--examples/application5/exampleappwin.c2
-rw-r--r--examples/application6/exampleappwin.c2
-rw-r--r--examples/application7/exampleappwin.c4
-rw-r--r--examples/application8/exampleappwin.c6
-rw-r--r--examples/application9/exampleappwin.c8
-rw-r--r--examples/bp/bloatpad.c2
-rw-r--r--examples/plugman.c2
-rw-r--r--examples/sunny.c2
11 files changed, 20 insertions, 20 deletions
diff --git a/examples/application10/exampleappwin.c b/examples/application10/exampleappwin.c
index 31f527b128..16a8658f36 100644
--- a/examples/application10/exampleappwin.c
+++ b/examples/application10/exampleappwin.c
@@ -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));
diff --git a/examples/application3/exampleappwin.c b/examples/application3/exampleappwin.c
index 01fb4ae115..9ed0b88452 100644
--- a/examples/application3/exampleappwin.c
+++ b/examples/application3/exampleappwin.c
@@ -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))
diff --git a/examples/application4/exampleappwin.c b/examples/application4/exampleappwin.c
index 01fb4ae115..9ed0b88452 100644
--- a/examples/application4/exampleappwin.c
+++ b/examples/application4/exampleappwin.c
@@ -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))
diff --git a/examples/application5/exampleappwin.c b/examples/application5/exampleappwin.c
index ca45b85d40..16d11f4c70 100644
--- a/examples/application5/exampleappwin.c
+++ b/examples/application5/exampleappwin.c
@@ -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));
diff --git a/examples/application6/exampleappwin.c b/examples/application6/exampleappwin.c
index ca45b85d40..16d11f4c70 100644
--- a/examples/application6/exampleappwin.c
+++ b/examples/application6/exampleappwin.c
@@ -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));
diff --git a/examples/application7/exampleappwin.c b/examples/application7/exampleappwin.c
index d4a671cc45..f15cf3ba42 100644
--- a/examples/application7/exampleappwin.c
+++ b/examples/application7/exampleappwin.c
@@ -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));
diff --git a/examples/application8/exampleappwin.c b/examples/application8/exampleappwin.c
index f662b67cbb..f21eeec5cc 100644
--- a/examples/application8/exampleappwin.c
+++ b/examples/application8/exampleappwin.c
@@ -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));
diff --git a/examples/application9/exampleappwin.c b/examples/application9/exampleappwin.c
index 0394904d76..725ee67df1 100644
--- a/examples/application9/exampleappwin.c
+++ b/examples/application9/exampleappwin.c
@@ -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));
diff --git a/examples/bp/bloatpad.c b/examples/bp/bloatpad.c
index f8f48d4fc9..3cb619eb8f 100644
--- a/examples/bp/bloatpad.c
+++ b/examples/bp/bloatpad.c
@@ -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);
diff --git a/examples/plugman.c b/examples/plugman.c
index d36b28bfb1..1b33f0eeb4 100644
--- a/examples/plugman.c
+++ b/examples/plugman.c
@@ -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);
diff --git a/examples/sunny.c b/examples/sunny.c
index 7aa4a9f89e..86d4d73fc0 100644
--- a/examples/sunny.c
+++ b/examples/sunny.c
@@ -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)