[balsa/gtk3] Migrate from GtkTable to GtkGrid
- From: Peter Bloomfield <PeterB src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Migrate from GtkTable to GtkGrid
- Date: Tue, 4 Oct 2011 02:14:42 +0000 (UTC)
commit fa07d61afee915ddccf36891e7387123a2021013
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Mon Oct 3 22:06:39 2011 -0400
Migrate from GtkTable to GtkGrid
* libbalsa/address.c (libbalsa_address_get_edit_widget): migrate
from GtkTable to GtkGrid.
ChangeLog | 5 +++++
libbalsa/address.c | 21 ++++++++++-----------
2 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1bf1098..44454c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2011-10-03 Peter Bloomfield
+ * libbalsa/address.c (libbalsa_address_get_edit_widget): migrate
+ from GtkTable to GtkGrid.
+
+2011-10-03 Peter Bloomfield
+
* libbalsa/misc.c (libbalsa_create_grid),
(libbalsa_create_grid_label), (libbalsa_create_grid_check),
(libbalsa_create_grid_entry), (lb_create_size_group_func):
diff --git a/libbalsa/address.c b/libbalsa/address.c
index ed7a254..dc4588d 100644
--- a/libbalsa/address.c
+++ b/libbalsa/address.c
@@ -956,14 +956,14 @@ libbalsa_address_get_edit_widget(const LibBalsaAddress *address,
N_("_Email Address:")
};
- GtkWidget *table, *label, *lhs;
+ GtkWidget *grid, *label, *lhs;
gint cnt;
- table = gtk_table_new(NUM_FIELDS, 2, FALSE);
+ grid = gtk_grid_new();
#define HIG_PADDING 6
- gtk_table_set_row_spacings(GTK_TABLE(table), HIG_PADDING);
- gtk_table_set_col_spacings(GTK_TABLE(table), HIG_PADDING);
- gtk_container_set_border_width(GTK_CONTAINER(table), HIG_PADDING);
+ gtk_grid_set_row_spacing(GTK_GRID(grid), HIG_PADDING);
+ gtk_grid_set_column_spacing(GTK_GRID(grid), HIG_PADDING);
+ gtk_container_set_border_width(GTK_CONTAINER(grid), HIG_PADDING);
for (cnt = 0; cnt < NUM_FIELDS; cnt++) {
if (!labels[cnt])
@@ -999,14 +999,13 @@ libbalsa_address_get_edit_widget(const LibBalsaAddress *address,
}
gtk_label_set_mnemonic_widget(GTK_LABEL(label), entries[cnt]);
- gtk_table_attach(GTK_TABLE(table), lhs, 0, 1, cnt + 1, cnt + 2,
- GTK_FILL, GTK_FILL, 4, 4);
+ gtk_grid_attach(GTK_GRID(grid), lhs, 0, cnt + 1, 1, 1);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
- gtk_table_attach(GTK_TABLE(table), entries[cnt], 1, 2, cnt + 1,
- cnt + 2, GTK_FILL | GTK_EXPAND,
- GTK_FILL | GTK_EXPAND, 2, 2);
+ gtk_widget_set_hexpand(entries[cnt], TRUE);
+ gtk_widget_set_vexpand(entries[cnt], TRUE);
+ gtk_grid_attach(GTK_GRID(grid), entries[cnt], 1, cnt + 1, 1, 1);
}
g_signal_connect(entries[FIRST_NAME], "changed",
G_CALLBACK(lba_entry_changed), entries);
@@ -1025,7 +1024,7 @@ libbalsa_address_get_edit_widget(const LibBalsaAddress *address,
g_signal_connect_swapped(G_OBJECT(model), "row-deleted",
changed_cb, changed_data);
}
- return table;
+ return grid;
}
LibBalsaAddress *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]