summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-03-10 18:05:57 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-04-26 17:59:42 +0200
commit1e6eb1f8b94ad10f30678285860dc24877bbbac3 (patch)
treeeef4b5f579a657072967e7f7dd047494af5add1d /examples
parentbf82149271b4f6bf6379b22eeea191dffe6823dd (diff)
downloadgtk+-1e6eb1f8b94ad10f30678285860dc24877bbbac3.tar.gz
draggesture: Port to new API model
Diffstat (limited to 'examples')
-rw-r--r--examples/drawing.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/drawing.c b/examples/drawing.c
index 0713b81611..08f2872105 100644
--- a/examples/drawing.c
+++ b/examples/drawing.c
@@ -157,10 +157,9 @@ activate (GtkApplication *app,
g_signal_connect_after (drawing_area, "size-allocate",
G_CALLBACK (size_allocate_cb), NULL);
- drag = gtk_gesture_drag_new (drawing_area);
+ drag = gtk_gesture_drag_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (drag), GDK_BUTTON_PRIMARY);
- g_object_set_data_full (G_OBJECT (drawing_area), "drag", drag, g_object_unref);
-
+ gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (drag));
g_signal_connect (drag, "drag-begin", G_CALLBACK (drag_begin), drawing_area);
g_signal_connect (drag, "drag-update", G_CALLBACK (drag_update), drawing_area);
g_signal_connect (drag, "drag-end", G_CALLBACK (drag_end), drawing_area);