]> Pileus Git - ~andy/gtk/commitdiff
tests: Add checkbox to enable kinetic scrolling in scrolled window test
authorCarlos Garcia Campos <cgarcia@igalia.com>
Fri, 11 Feb 2011 12:45:21 +0000 (13:45 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 1 Mar 2012 21:25:22 +0000 (16:25 -0500)
tests/testscrolledwindow.c

index 97177f9952e9e948c5177e6199fa9f013333dc2b..f0cc9c01572664f289bdc9b4e690091c5be3f8b8 100644 (file)
@@ -53,6 +53,16 @@ content_height_changed (GtkSpinButton *spin_button,
   gtk_scrolled_window_set_min_content_height (swindow, (gint)value);
 }
 
+static void
+kinetic_scrolling_changed (GtkToggleButton *toggle_button,
+                           gpointer         data)
+{
+  GtkScrolledWindow *swindow = data;
+  gboolean enabled = gtk_toggle_button_get_active (toggle_button);
+
+  gtk_scrolled_window_set_kinetic_scrolling (swindow, enabled);
+}
+
 static void
 scrollable_policy (void)
 {
@@ -199,6 +209,13 @@ scrollable_policy (void)
   g_signal_connect (G_OBJECT (widget), "changed",
                     G_CALLBACK (label_flip_changed), label);
 
+  /* Add Kinetic scrolling control here */
+  widget = gtk_check_button_new_with_label ("Kinetic scrolling");
+  gtk_widget_show (widget);
+  gtk_box_pack_start (GTK_BOX (cntl), widget, TRUE, TRUE, 0);
+  g_signal_connect (G_OBJECT (widget), "toggled",
+                    G_CALLBACK (kinetic_scrolling_changed), swindow);
+
   gtk_widget_show (window);
 }