summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-10-31 14:09:48 -0400
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-11-02 12:04:35 +0900
commitc50f79041776098cecc4b65bbe4305173dff0847 (patch)
tree6f8d0c70739b5ecc4705de0173f139ba2a739110 /tests
parent76a0b9e5fa1436ebe20c344f6320cecd541148f1 (diff)
downloadgtk+-c50f79041776098cecc4b65bbe4305173dff0847.tar.gz
Add content size test for scrolled window
Diffstat (limited to 'tests')
-rw-r--r--tests/testscrolledwindow.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/testscrolledwindow.c b/tests/testscrolledwindow.c
index 0b00f2566c..ddfaf85cb9 100644
--- a/tests/testscrolledwindow.c
+++ b/tests/testscrolledwindow.c
@@ -31,6 +31,27 @@ label_flip_changed (GtkComboBox *combo_box,
gtk_label_set_angle (label, 90.0);
}
+static void
+content_width_changed (GtkSpinButton *spin_button,
+ gpointer data)
+{
+ GtkScrolledWindow *swindow = data;
+ gdouble value;
+
+ value = gtk_spin_button_get_value (spin_button);
+ gtk_scrolled_window_set_min_content_width (swindow, (gint)value);
+}
+
+static void
+content_height_changed (GtkSpinButton *spin_button,
+ gpointer data)
+{
+ GtkScrolledWindow *swindow = data;
+ gdouble value;
+
+ value = gtk_spin_button_get_value (spin_button);
+ gtk_scrolled_window_set_min_content_height (swindow, (gint)value);
+}
static void
scrollable_policy (void)
@@ -127,6 +148,36 @@ scrollable_policy (void)
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (vertical_policy_changed), viewport);
+ /* Content size controls */
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 2);
+
+ widget = gtk_label_new ("min-content-width");
+ gtk_widget_show (widget);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0);
+
+ widget = gtk_spin_button_new_with_range (100.0, 1000.0, 10.0);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (cntl), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+ gtk_widget_show (hbox);
+
+ g_signal_connect (G_OBJECT (widget), "value-changed",
+ G_CALLBACK (content_width_changed), swindow);
+
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 2);
+
+ widget = gtk_label_new ("min-content-height");
+ gtk_widget_show (widget);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0);
+
+ widget = gtk_spin_button_new_with_range (100.0, 1000.0, 10.0);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (cntl), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+ gtk_widget_show (hbox);
+
+ g_signal_connect (G_OBJECT (widget), "value-changed",
+ G_CALLBACK (content_height_changed), swindow);
/* Add Label orientation control here */
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 2);