[gtk+/touchscreens: 5/65] test: Add checkbox to enable/disable kinetic scrolling in scrolled window test
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/touchscreens: 5/65] test: Add checkbox to enable/disable kinetic scrolling in scrolled window test
- Date: Tue, 13 Dec 2011 18:56:30 +0000 (UTC)
commit 31d9f7b2eba329cf045fddbae17014e6a5aca8d2
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Fri Feb 11 13:45:21 2011 +0100
test: Add checkbox to enable/disable kinetic scrolling in scrolled window test
tests/testscrolledwindow.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/tests/testscrolledwindow.c b/tests/testscrolledwindow.c
index 97177f9..f0cc9c0 100644
--- a/tests/testscrolledwindow.c
+++ b/tests/testscrolledwindow.c
@@ -54,6 +54,16 @@ content_height_changed (GtkSpinButton *spin_button,
}
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)
{
GtkWidget *window, *swindow, *hbox, *vbox, *frame, *cntl;
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]