[gtk+/gestures: 42/140] demo: Update to gesture API change



commit 3b0b34e727e7a76ba2956a73c52567bca9963ef0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 24 14:44:27 2014 +0100

    demo: Update to gesture API change

 demos/gtk-demo/gestures.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/demos/gtk-demo/gestures.c b/demos/gtk-demo/gestures.c
index b9759c0..28db04f 100644
--- a/demos/gtk-demo/gestures.c
+++ b/demos/gtk-demo/gestures.c
@@ -156,8 +156,7 @@ do_gestures (GtkWidget *do_widget)
       gesture = gtk_gesture_swipe_new (drawing_area);
       g_signal_connect (gesture, "swipe",
                         G_CALLBACK (swipe_gesture_swept), drawing_area);
-      gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (gesture),
-                                 GTK_PHASE_BUBBLE);
+      gtk_widget_add_gesture (drawing_area, gesture, GTK_PHASE_BUBBLE);
 
       /* Long press */
       gesture = gtk_gesture_long_press_new (drawing_area);
@@ -165,22 +164,19 @@ do_gestures (GtkWidget *do_widget)
                         G_CALLBACK (long_press_gesture_pressed), drawing_area);
       g_signal_connect (gesture, "end",
                         G_CALLBACK (long_press_gesture_end), drawing_area);
-      gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (gesture),
-                                 GTK_PHASE_BUBBLE);
+      gtk_widget_add_gesture (drawing_area, gesture, GTK_PHASE_BUBBLE);
 
       /* Rotate */
       rotate = gesture = gtk_gesture_rotate_new (drawing_area);
       g_signal_connect (gesture, "angle-changed",
                         G_CALLBACK (rotation_angle_changed), drawing_area);
-      gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (gesture),
-                                 GTK_PHASE_BUBBLE);
+      gtk_widget_add_gesture (drawing_area, gesture, GTK_PHASE_BUBBLE);
 
       /* Zoom */
       zoom = gesture = gtk_gesture_zoom_new (drawing_area);
       g_signal_connect (gesture, "scale-changed",
                         G_CALLBACK (zoom_scale_changed), drawing_area);
-      gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (gesture),
-                                 GTK_PHASE_BUBBLE);
+      gtk_widget_add_gesture (drawing_area, gesture, GTK_PHASE_BUBBLE);
     }
 
   if (!gtk_widget_get_visible (window))


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