Gtk Gestures

Hello everyone,

I am trying to catch the gtk "rotate" and "zoom" gestures. I wrote a small program just to test how they work in gtk. However both callback functions for "zoom" and "rotate" gesture are getting called even if I make only one type of gesture, but this shouldn't be correct, Could anyone please explain me what am I missing here ?
Thank you very much

#include <gtk/gtk.h>
static void
zoom_gesture_update(GtkGestureZoom* gesture,GdkEventSequence *sequence,GtkWidget* window)
    static int i=1;
    g_print("\nzoom gesture update %d",i);
static void
rotate_gesture_update(GtkGestureRotate* gesture, GdkEventSequence *sequence, GtkWidget* window)
    static int i=1;
    g_print("\nrotate_gesture_update %d",i);
main (int    argc,
      char **argv)
  GtkWidget *window;
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (window), "Window");
  gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
  GtkGesture* gesture_zoom = gtk_gesture_zoom_new(window);
  gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture_zoom), GTK_PHASE_BUBBLE);

  GtkGesture* gesture_rotate = gtk_gesture_rotate_new(window);

  gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture_rotate), GTK_PHASE_BUBBLE);

  gtk_widget_show_all (window);


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