[gtk+] testgtk: Convert panes example from GtkTable to GtkGrid
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] testgtk: Convert panes example from GtkTable to GtkGrid
- Date: Wed, 28 Sep 2011 23:55:20 +0000 (UTC)
commit 9aed1514b7ed928b2c4c55f7aa59c8e1618cd3d1
Author: Benjamin Otte <otte redhat com>
Date: Thu Sep 29 00:41:35 2011 +0200
testgtk: Convert panes example from GtkTable to GtkGrid
tests/testgtk.c | 27 ++++++++++-----------------
1 files changed, 10 insertions(+), 17 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 61fa5a4..6bd66a8 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -6310,7 +6310,7 @@ create_pane_options (GtkPaned *paned,
{
GtkWidget *child1, *child2;
GtkWidget *frame;
- GtkWidget *table;
+ GtkWidget *grid;
GtkWidget *label;
GtkWidget *button;
GtkWidget *check_button;
@@ -6321,23 +6321,20 @@ create_pane_options (GtkPaned *paned,
frame = gtk_frame_new (frame_label);
gtk_container_set_border_width (GTK_CONTAINER (frame), 4);
- table = gtk_table_new (4, 2, 4);
- gtk_container_add (GTK_CONTAINER (frame), table);
+ grid = gtk_grid_new ();
+ gtk_container_add (GTK_CONTAINER (frame), grid);
label = gtk_label_new (label1);
- gtk_table_attach_defaults (GTK_TABLE (table), label,
- 0, 1, 0, 1);
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
check_button = gtk_check_button_new_with_label ("Resize");
- gtk_table_attach_defaults (GTK_TABLE (table), check_button,
- 0, 1, 1, 2);
+ gtk_grid_attach (GTK_GRID (grid), check_button, 0, 1, 1, 1);
g_signal_connect (check_button, "toggled",
G_CALLBACK (toggle_resize),
child1);
check_button = gtk_check_button_new_with_label ("Shrink");
- gtk_table_attach_defaults (GTK_TABLE (table), check_button,
- 0, 1, 2, 3);
+ gtk_grid_attach (GTK_GRID (grid), check_button, 0, 2, 1, 1);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
TRUE);
g_signal_connect (check_button, "toggled",
@@ -6345,12 +6342,10 @@ create_pane_options (GtkPaned *paned,
child1);
label = gtk_label_new (label2);
- gtk_table_attach_defaults (GTK_TABLE (table), label,
- 1, 2, 0, 1);
+ gtk_grid_attach (GTK_GRID (grid), label, 1, 0, 1, 1);
check_button = gtk_check_button_new_with_label ("Resize");
- gtk_table_attach_defaults (GTK_TABLE (table), check_button,
- 1, 2, 1, 2);
+ gtk_grid_attach (GTK_GRID (grid), check_button, 1, 1, 1, 1);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
TRUE);
g_signal_connect (check_button, "toggled",
@@ -6358,8 +6353,7 @@ create_pane_options (GtkPaned *paned,
child2);
check_button = gtk_check_button_new_with_label ("Shrink");
- gtk_table_attach_defaults (GTK_TABLE (table), check_button,
- 1, 2, 2, 3);
+ gtk_grid_attach (GTK_GRID (grid), check_button, 1, 2, 1, 1);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
TRUE);
g_signal_connect (check_button, "toggled",
@@ -6367,8 +6361,7 @@ create_pane_options (GtkPaned *paned,
child2);
button = gtk_button_new_with_mnemonic ("_Properties");
- gtk_table_attach_defaults (GTK_TABLE (table), button,
- 0, 2, 3, 4);
+ gtk_grid_attach (GTK_GRID (grid), button, 0, 3, 2, 1);
g_signal_connect (button, "clicked",
G_CALLBACK (paned_props_clicked),
paned);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]