[gtk/dnd-gestures-2: 130/173] gtk-demo: Use GDK content formats api



commit 9cc29efa254593429bbfa1e549681e3f9ead1448
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 7 00:44:19 2020 -0500

    gtk-demo: Use GDK content formats api

 demos/gtk-demo/clipboard.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/demos/gtk-demo/clipboard.c b/demos/gtk-demo/clipboard.c
index 303ff313f6..578bc6d7bf 100644
--- a/demos/gtk-demo/clipboard.c
+++ b/demos/gtk-demo/clipboard.c
@@ -349,8 +349,7 @@ do_clipboard (GtkWidget *do_widget)
       gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
 
       /* accept drops on image */
-      formats = gdk_content_formats_new (NULL, 0);
-      formats = gtk_content_formats_add_image_targets (formats, FALSE);
+      formats = gdk_content_formats_new_for_gtype (GDK_TYPE_TEXTURE);
       dest = gtk_drop_target_new (formats, GDK_ACTION_COPY);
       gdk_content_formats_unref (formats);
       g_signal_connect (dest, "drag-drop", G_CALLBACK (drag_drop), image);
@@ -381,8 +380,7 @@ do_clipboard (GtkWidget *do_widget)
       gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
 
       /* accept drops on image */
-      formats = gdk_content_formats_new (NULL, 0);
-      formats = gtk_content_formats_add_image_targets (formats, FALSE);
+      formats = gdk_content_formats_new_for_gtype (GDK_TYPE_TEXTURE);
       dest = gtk_drop_target_new (formats, GDK_ACTION_COPY);
       gdk_content_formats_unref (formats);
       g_signal_connect (dest, "drag-drop", G_CALLBACK (drag_drop), image);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]