diff options
author | Benjamin Otte <otte@redhat.com> | 2018-03-10 18:05:57 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-04-26 17:59:42 +0200 |
commit | 1e6eb1f8b94ad10f30678285860dc24877bbbac3 (patch) | |
tree | eef4b5f579a657072967e7f7dd047494af5add1d /examples | |
parent | bf82149271b4f6bf6379b22eeea191dffe6823dd (diff) | |
download | gtk+-1e6eb1f8b94ad10f30678285860dc24877bbbac3.tar.gz |
draggesture: Port to new API model
Diffstat (limited to 'examples')
-rw-r--r-- | examples/drawing.c | 5 |
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); |