[gtk+] testgtk: Convert focus example from GtkTable to GtkGrid
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] testgtk: Convert focus example from GtkTable to GtkGrid
- Date: Wed, 28 Sep 2011 03:36:31 +0000 (UTC)
commit 94f77029f7e59ebfc26c3551643aaeb14c5464c2
Author: Benjamin Otte <otte redhat com>
Date: Wed Sep 28 05:03:20 2011 +0200
testgtk: Convert focus example from GtkTable to GtkGrid
tests/testgtk.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 932e6b7..44a176d 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -5250,10 +5250,13 @@ create_flipping (GtkWidget *widget)
static GtkWidget*
make_focus_table (GList **list)
{
- GtkWidget *table;
+ GtkWidget *grid;
gint i, j;
- table = gtk_table_new (5, 5, FALSE);
+ grid = gtk_grid_new ();
+
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 10);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
for (i = 0; i < 5; i++)
{
@@ -5268,19 +5271,16 @@ make_focus_table (GList **list)
*list = g_list_prepend (*list, widget);
- gtk_table_attach (GTK_TABLE (table),
- widget,
- i, i + 1,
- j, j + 1,
- GTK_EXPAND | GTK_FILL,
- GTK_EXPAND | GTK_FILL,
- 5, 5);
+ gtk_widget_set_hexpand (widget, TRUE);
+ gtk_widget_set_vexpand (widget, TRUE);
+
+ gtk_grid_attach (GTK_GRID (grid), widget, i, j, 1, 1);
}
}
*list = g_list_reverse (*list);
- return table;
+ return grid;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]