summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-09-01 12:24:06 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-09-01 12:24:06 -0400
commitb628338db3e0bb4c906424294e4e988d45ed26f3 (patch)
treec1f5c407a2ff107c2fc43fe33d74b75d74a2bc2e /tests
parent7051fdee5da136c5c779bf8c1d9f1b3369eb30fb (diff)
downloadgtk+-b628338db3e0bb4c906424294e4e988d45ed26f3.tar.gz
list widgets: Simplify the constructors
Now that both arguments to the _new_with_factory() constructors are nullable, there's no good reason to keep a separate _new() around. Just make gtk_list_view_new() and gtk_grid_view_new() take both a model and a factory.
Diffstat (limited to 'tests')
-rw-r--r--tests/testcolumnview.c2
-rw-r--r--tests/testlistdnd.c6
-rw-r--r--tests/testlistview-animating.c2
-rw-r--r--tests/testlistview.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/testcolumnview.c b/tests/testcolumnview.c
index 725ce67b7a..d38e83ce6d 100644
--- a/tests/testcolumnview.c
+++ b/tests/testcolumnview.c
@@ -773,7 +773,7 @@ main (int argc, char *argv[])
g_object_unref (filter);
- list = gtk_list_view_new_with_factory (
+ list = gtk_list_view_new (
GTK_SELECTION_MODEL (gtk_single_selection_new (g_object_ref (gtk_column_view_get_columns (GTK_COLUMN_VIEW (view))))),
gtk_builder_list_item_factory_new_from_bytes (scope, g_bytes_new_static (factory_ui, strlen (factory_ui))));
gtk_box_append (GTK_BOX (hbox), list);
diff --git a/tests/testlistdnd.c b/tests/testlistdnd.c
index 899ed1edc1..803ff2164d 100644
--- a/tests/testlistdnd.c
+++ b/tests/testlistdnd.c
@@ -348,7 +348,7 @@ main (int argc, char *argv[])
g_signal_connect (factory, "bind", G_CALLBACK (bind_item), NULL);
g_signal_connect (factory, "unbind", G_CALLBACK (unbind_item), NULL);
- grid = gtk_grid_view_new_with_factory (GTK_SELECTION_MODEL (gtk_single_selection_new (model)), factory);
+ grid = gtk_grid_view_new (GTK_SELECTION_MODEL (gtk_single_selection_new (model)), factory);
gtk_grid_view_set_min_columns (GTK_GRID_VIEW (grid), 20);
gtk_grid_view_set_max_columns (GTK_GRID_VIEW (grid), 20);
@@ -359,7 +359,7 @@ main (int argc, char *argv[])
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (sw), TRUE);
gtk_stack_add_titled (GTK_STACK (stack), sw, "list", "GtkListView");
- list = gtk_list_view_new (GTK_SELECTION_MODEL (gtk_single_selection_new (create_model (0, 400, 1, FALSE))));
+ list = gtk_list_view_new (GTK_SELECTION_MODEL (gtk_single_selection_new (create_model (0, 400, 1, FALSE))), NULL);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), list);
factory = gtk_signal_list_item_factory_new ();
@@ -401,7 +401,7 @@ main (int argc, char *argv[])
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (sw), TRUE);
gtk_stack_add_titled (GTK_STACK (stack), sw, "tree", "Tree");
- list = gtk_list_view_new (GTK_SELECTION_MODEL (gtk_single_selection_new (create_tree_model (20, 20))));
+ list = gtk_list_view_new (GTK_SELECTION_MODEL (gtk_single_selection_new (create_tree_model (20, 20))), NULL);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), list);
factory = gtk_signal_list_item_factory_new ();
diff --git a/tests/testlistview-animating.c b/tests/testlistview-animating.c
index 70aa4a1de6..33c69e3565 100644
--- a/tests/testlistview-animating.c
+++ b/tests/testlistview-animating.c
@@ -149,7 +149,7 @@ main (int argc,
factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup_list_item), NULL);
g_signal_connect (factory, "bind", G_CALLBACK (bind_list_item), NULL);
- listview = gtk_list_view_new_with_factory (NULL, factory);
+ listview = gtk_list_view_new (NULL, factory);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview);
diff --git a/tests/testlistview.c b/tests/testlistview.c
index fcbac01e3c..53234078b5 100644
--- a/tests/testlistview.c
+++ b/tests/testlistview.c
@@ -615,7 +615,7 @@ main (int argc, char *argv[])
factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup_widget), NULL);
- listview = gtk_list_view_new_with_factory (NULL, factory);
+ listview = gtk_list_view_new (NULL, factory);
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview);
if (argc > 1)