[gtk+] Test size constraints



commit 08f8fd2f5c8e34bd386e5b965fc25fb59e7e123a
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 14 13:45:47 2014 -0400

    Test size constraints
    
    This adds some min/max size hints to testimage.

 tests/testimage.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/tests/testimage.c b/tests/testimage.c
index 3ad95e6..1b2bb0f 100644
--- a/tests/testimage.c
+++ b/tests/testimage.c
@@ -104,6 +104,7 @@ main (int argc, char **argv)
   gchar *anim_filename = NULL;
   GIcon *icon;
   GFile *file;
+  GdkGeometry geo;
 
   gtk_init (&argc, &argv);
 
@@ -114,6 +115,14 @@ main (int argc, char **argv)
     anim_filename = argv[2];
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+  geo.min_width = 400;
+  geo.min_height = 300;
+  geo.max_width = 800;
+  geo.max_height = 600;
+
+  gtk_window_set_geometry_hints (GTK_WINDOW (window), NULL, &geo, GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
+
   grid = gtk_grid_new ();
   gtk_container_add (GTK_CONTAINER (window), grid);
 


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