[gtk/dnd-gestures-2: 104/150] gtk-demo: Use gtk_widget_add_controller for drag source
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/dnd-gestures-2: 104/150] gtk-demo: Use gtk_widget_add_controller for drag source
- Date: Tue, 7 Jan 2020 07:00:39 +0000 (UTC)
commit 8c09f63d534333eb918c5553338af2cf1b7fcc8e
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jan 7 01:06:39 2020 -0500
gtk-demo: Use gtk_widget_add_controller for drag source
demos/gtk-demo/clipboard.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/demos/gtk-demo/clipboard.c b/demos/gtk-demo/clipboard.c
index 3da096060e..303ff313f6 100644
--- a/demos/gtk-demo/clipboard.c
+++ b/demos/gtk-demo/clipboard.c
@@ -344,9 +344,9 @@ do_clipboard (GtkWidget *do_widget)
/* make image a drag source */
source = gtk_drag_source_new ();
- gtk_drag_source_attach (source, image, GDK_BUTTON1_MASK);
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
+ gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
/* accept drops on image */
formats = gdk_content_formats_new (NULL, 0);
@@ -378,7 +378,7 @@ do_clipboard (GtkWidget *do_widget)
source = gtk_drag_source_new ();
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
- gtk_drag_source_attach (source, image, GDK_BUTTON1_MASK);
+ gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
/* accept drops on image */
formats = gdk_content_formats_new (NULL, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]