diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-07-26 18:50:50 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-07-26 18:50:50 -0400 |
commit | eb5c76210eb8897f61f5c4b3cbdd32bcee87f92b (patch) | |
tree | 8d004d7997cbe3acd6c876ba0b97adc3936b37f0 /tests | |
parent | fc22b75a06e9ee0298e63694299680c6a9a6d598 (diff) | |
download | gtk+-eb5c76210eb8897f61f5c4b3cbdd32bcee87f92b.tar.gz |
gridview: Revise constructors
Make both gtk_grid_view_new and gtk_grid_view_new_with_factory
take a model as first argument, and make all arguments
allow-none and transfer full.
Update all callers.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testlistdnd.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/testlistdnd.c b/tests/testlistdnd.c index 0f404f4221..b58cf82c7d 100644 --- a/tests/testlistdnd.c +++ b/tests/testlistdnd.c @@ -342,23 +342,17 @@ main (int argc, char *argv[]) gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (sw), TRUE); gtk_stack_add_titled (GTK_STACK (stack), sw, "grid", "GtkGridView"); - grid = gtk_grid_view_new (); - gtk_grid_view_set_min_columns (GTK_GRID_VIEW (grid), 20); - gtk_grid_view_set_max_columns (GTK_GRID_VIEW (grid), 20); - - gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), grid); - model = create_model (0, 400, 1, FALSE); - gtk_grid_view_set_model (GTK_GRID_VIEW (grid), model); - g_object_unref (model); - factory = gtk_signal_list_item_factory_new (); g_signal_connect (factory, "setup", G_CALLBACK (setup_item), NULL); g_signal_connect (factory, "bind", G_CALLBACK (bind_item), NULL); g_signal_connect (factory, "unbind", G_CALLBACK (unbind_item), NULL); - gtk_grid_view_set_factory (GTK_GRID_VIEW (grid), factory); - g_object_unref (factory); + grid = gtk_grid_view_new_with_factory (model, factory); + gtk_grid_view_set_min_columns (GTK_GRID_VIEW (grid), 20); + gtk_grid_view_set_max_columns (GTK_GRID_VIEW (grid), 20); + + gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), grid); /* list */ sw = gtk_scrolled_window_new (); |