[gtk+/grid-widget-2: 13/18] Another grid test
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/grid-widget-2: 13/18] Another grid test
- Date: Mon, 11 Oct 2010 03:59:16 +0000 (UTC)
commit 81f07fb741f0369f3ea9582aab87e642fd0b21f9
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Oct 10 02:10:39 2010 -0400
Another grid test
tests/testgrid.c | 42 ++++++++++++++++++++++++++++++++++++------
1 files changed, 36 insertions(+), 6 deletions(-)
---
diff --git a/tests/testgrid.c b/tests/testgrid.c
index 4355df0..0d0b8f3 100644
--- a/tests/testgrid.c
+++ b/tests/testgrid.c
@@ -29,7 +29,7 @@ toggle_orientation (GtkWidget *window, GdkEventButton *event, GtkGrid *grid)
}
static void
-open_simple_grid (void)
+simple_grid (void)
{
GtkWidget *window;
GtkWidget *grid;
@@ -57,7 +57,7 @@ open_simple_grid (void)
}
static void
-open_text_grid (void)
+text_grid (void)
{
GtkWidget *window;
GtkWidget *grid;
@@ -98,7 +98,7 @@ open_text_grid (void)
}
static void
-open_box_comparison (void)
+box_comparison (void)
{
GtkWidget *window;
GtkWidget *vbox;
@@ -161,14 +161,44 @@ open_box_comparison (void)
gtk_widget_show_all (window);
}
+static void
+empty_line (void)
+{
+ GtkWidget *window;
+ GtkWidget *grid;
+ GtkWidget *child;
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ grid = gtk_grid_new ();
+ gtk_container_add (GTK_CONTAINER (window), grid);
+
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 10);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 20);
+
+ child = test_widget ("(0, 0)", "red");
+ gtk_grid_attach (GTK_GRID (grid), child, 0, 0, 1, 1);
+ gtk_container_child_set (GTK_CONTAINER (grid), child,
+ "hexpand", TRUE,
+ "vexpand", TRUE,
+ NULL);
+
+ gtk_grid_attach (GTK_GRID (grid), test_widget ("(0, 1)", "blue"), 0, 1, 1, 1);
+
+ gtk_grid_attach (GTK_GRID (grid), test_widget ("(10, 0)", "green"), 10, 0, 1, 1);
+ gtk_grid_attach (GTK_GRID (grid), test_widget ("(10, 1)", "magenta"), 10, 1, 1, 1);
+
+ gtk_widget_show_all (window);
+}
+
int
main (int argc, char *argv[])
{
gtk_init (NULL, NULL);
- open_simple_grid ();
- open_text_grid ();
- open_box_comparison ();
+ simple_grid ();
+ text_grid ();
+ box_comparison ();
+ empty_line ();
gtk_main ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]