summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-10-31 14:09:48 -0400
committerMatthias Clasen <mclasen@redhat.com>2010-10-31 14:10:41 -0400
commit81d7dd07742d20bd5a03c8244c2c5b3e94be9f68 (patch)
tree0d9d41bd66c95fa6ff33fd1e5c1e8432454f1d13 /tests
parentcbbfd7beb6c7faed9ba73bd8e3b7523a61e98f23 (diff)
downloadgtk+-81d7dd07742d20bd5a03c8244c2c5b3e94be9f68.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);