diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-06-29 16:37:14 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-06-29 22:10:34 -0400 |
commit | c267a75eef2e7461e092bc1d7fd09596c1053eae (patch) | |
tree | 73ad736774ca0924e6e4313e09d2cd0f16679c66 /tests/testlistview-animating.c | |
parent | 7170fdebb9024f6f87085c8e4665431f051592d2 (diff) | |
download | gtk+-c267a75eef2e7461e092bc1d7fd09596c1053eae.tar.gz |
Stop using GtkFunctionsListItemFactory
This was an early attempt at a factory, and has been
superseded by GtkSignalsListItemFactory. Port all users
the the newer one.
Diffstat (limited to 'tests/testlistview-animating.c')
-rw-r--r-- | tests/testlistview-animating.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/testlistview-animating.c b/tests/testlistview-animating.c index a69cb9a6fd..d824118d78 100644 --- a/tests/testlistview-animating.c +++ b/tests/testlistview-animating.c @@ -9,8 +9,8 @@ #endif static void -setup_list_item (GtkListItem *list_item, - gpointer unused) +setup_list_item (GtkSignalListItemFactory *factory, + GtkListItem *list_item) { GtkWidget *label = gtk_label_new (""); @@ -18,8 +18,8 @@ setup_list_item (GtkListItem *list_item, } static void -bind_list_item (GtkListItem *list_item, - gpointer unused) +bind_list_item (GtkSignalListItemFactory *factory, + GtkListItem *list_item) { GtkWidget *label; gpointer item; @@ -118,6 +118,7 @@ main (int argc, GtkSortListModel *sort; GtkSorter *sorter; guint i; + GtkListItemFactory *factory; gtk_init (); @@ -145,10 +146,11 @@ main (int argc, gtk_widget_set_vexpand (sw, TRUE); gtk_box_append (GTK_BOX (vbox), sw); - listview = gtk_list_view_new_with_factory ( - gtk_functions_list_item_factory_new (setup_list_item, - bind_list_item, - NULL, NULL)); + 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 (factory); + gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4); |