[gtk+/gestures: 72/117] demo: Update to gesture widget-level API changes
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gestures: 72/117] demo: Update to gesture widget-level API changes
- Date: Thu, 10 Apr 2014 20:30:45 +0000 (UTC)
commit 85616f483fd5ab24fc710fdd15c9b0e236b1e0fa
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Apr 8 20:59:16 2014 +0200
demo: Update to gesture widget-level API changes
demos/gtk-demo/gestures.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/demos/gtk-demo/gestures.c b/demos/gtk-demo/gestures.c
index 28db04f..387e357 100644
--- a/demos/gtk-demo/gestures.c
+++ b/demos/gtk-demo/gestures.c
@@ -156,7 +156,8 @@ 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_gesture (drawing_area, gesture, GTK_PHASE_BUBBLE);
+ gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (gesture));
+ g_object_unref (gesture);
/* Long press */
gesture = gtk_gesture_long_press_new (drawing_area);
@@ -164,19 +165,22 @@ 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_gesture (drawing_area, gesture, GTK_PHASE_BUBBLE);
+ gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (gesture));
+ g_object_unref (gesture);
/* 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_gesture (drawing_area, gesture, GTK_PHASE_BUBBLE);
+ gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (gesture));
+ g_object_unref (gesture);
/* 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_gesture (drawing_area, gesture, GTK_PHASE_BUBBLE);
+ gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (gesture));
+ g_object_unref (gesture);
}
if (!gtk_widget_get_visible (window))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]