[gnome-games] gnobots2: Replace GtkTable with GtkGrid
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gnobots2: Replace GtkTable with GtkGrid
- Date: Fri, 30 Dec 2011 03:20:48 +0000 (UTC)
commit 039448d9581e1ebf10b9bd34813e52b2cee28ba3
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Dec 30 14:07:17 2011 +1100
gnobots2: Replace GtkTable with GtkGrid
gnobots2/src/properties.c | 18 +++++++++---------
gnobots2/src/statusbar.c | 32 ++++++++++++++++----------------
2 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/gnobots2/src/properties.c b/gnobots2/src/properties.c
index 6feab89..9bb5552 100644
--- a/gnobots2/src/properties.c
+++ b/gnobots2/src/properties.c
@@ -413,7 +413,7 @@ show_properties_dialog (void)
GtkWidget *typemenu;
GtkWidget *pmapmenu;
GtkWidget *chkbox;
- GtkWidget *table;
+ GtkWidget *grid;
GtkWidget *dbut;
GtkWidget *frame;
GtkWidget *w;
@@ -507,25 +507,25 @@ show_properties_dialog (void)
frame = games_frame_new (_("Graphics Theme"));
gtk_box_pack_start (GTK_BOX (gpage), frame, FALSE, FALSE, 0);
- table = gtk_table_new (2, 2, FALSE);
- gtk_table_set_row_spacings (GTK_TABLE (table), 6);
- gtk_table_set_col_spacings (GTK_TABLE (table), 12);
- gtk_container_add (GTK_CONTAINER (frame), table);
+ grid = gtk_grid_new ();
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
+ gtk_container_add (GTK_CONTAINER (frame), grid);
label = gtk_label_new_with_mnemonic (_("_Image theme:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
pmapmenu = make_theme_menu ();
g_signal_connect (G_OBJECT (pmapmenu), "changed",
G_CALLBACK (pmap_selection), NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), pmapmenu);
- gtk_table_attach_defaults (GTK_TABLE (table), pmapmenu, 1, 2, 0, 1);
+ gtk_grid_attach (GTK_GRID (grid), pmapmenu, 1, 0, 1, 1);
label = gtk_label_new_with_mnemonic (_("_Background color:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
w = gtk_color_button_new ();
gtk_color_button_set_color (GTK_COLOR_BUTTON (w), &properties.bgcolour);
@@ -533,7 +533,7 @@ show_properties_dialog (void)
G_CALLBACK (bg_color_callback), NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), w);
- gtk_table_attach_defaults (GTK_TABLE (table), w, 1, 2, 1, 2);
+ gtk_grid_attach (GTK_GRID (grid), w, 1, 1, 1, 1);
label = gtk_label_new_with_mnemonic (_("Appearance"));
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), gpage, label);
diff --git a/gnobots2/src/statusbar.c b/gnobots2/src/statusbar.c
index e627bc1..0e3a0b0 100644
--- a/gnobots2/src/statusbar.c
+++ b/gnobots2/src/statusbar.c
@@ -31,7 +31,7 @@
/* File Static Variables */
/**********************************************************************/
static GtkWidget *statusbar = NULL;
-static GtkWidget *sbtbl = NULL;
+static GtkWidget *sbgrid = NULL;
static GtkWidget *score_label = NULL;
static GtkWidget *safe_label = NULL;
static GtkWidget *level_label = NULL;
@@ -62,51 +62,51 @@ gnobots_statusbar_new (void)
return statusbar;
}
- sbtbl = gtk_table_new (1, 11, FALSE);
+ sbgrid = gtk_grid_new ();
+ gtk_grid_set_column_spacing (GTK_GRID (sbgrid), 6);
label = gtk_label_new (_("Score:"));
- gtk_table_attach (GTK_TABLE (sbtbl), label, 0, 1, 0, 1, 0, 0, 3, 3);
+ gtk_grid_attach (GTK_GRID (sbgrid), label, 0, 0, 1, 1);
gtk_widget_show (label);
score_label = gtk_label_new ("0");
- gtk_table_attach (GTK_TABLE (sbtbl), score_label, 1, 2, 0, 1, 0, 0, 3, 3);
+ gtk_grid_attach (GTK_GRID (sbgrid), score_label, 1, 0, 1, 1);
gtk_widget_show (score_label);
- gtk_table_set_col_spacing (GTK_TABLE (sbtbl), 2, 12);
+ gtk_table_set_col_spacing (GTK_GRID (sbgrid), 2, 12);
label = gtk_label_new (_("Safe Teleports:"));
- gtk_table_attach (GTK_TABLE (sbtbl), label, 3, 4, 0, 1, 0, 0, 3, 3);
+ gtk_grid_attach (GTK_GRID (sbgrid), label, 3, 0, 1, 1);
gtk_widget_show (label);
safe_label = gtk_label_new ("0");
- gtk_table_attach (GTK_TABLE (sbtbl), safe_label, 4, 5, 0, 1, 0, 0, 3, 3);
+ gtk_grid_attach (GTK_GRID (sbgrid), safe_label, 4, 0, 1, 1);
gtk_widget_show (safe_label);
- gtk_table_set_col_spacing (GTK_TABLE (sbtbl), 5, 12);
+ gtk_table_set_col_spacing (GTK_GRID (sbgrid), 5, 12);
label = gtk_label_new (_("Level:"));
- gtk_table_attach (GTK_TABLE (sbtbl), label, 6, 7, 0, 1, 0, 0, 3, 3);
+ gtk_grid_attach (GTK_GRID (sbgrid), label, 6, 0, 1, 1);
gtk_widget_show (label);
level_label = gtk_label_new ("0");
- gtk_table_attach (GTK_TABLE (sbtbl), level_label, 7, 8, 0, 1, 0, 0, 3, 3);
+ gtk_grid_attach (GTK_GRID (sbgrid), level_label, 7, 0, 1, 1);
gtk_widget_show (level_label);
- gtk_table_set_col_spacing (GTK_TABLE (sbtbl), 8, 12);
+ gtk_table_set_col_spacing (GTK_GRID (sbgrid), 8, 12);
label = gtk_label_new (_("Remaining:"));
- gtk_table_attach (GTK_TABLE (sbtbl), label, 9, 10, 0, 1, 0, 0, 3, 3);
+ gtk_grid_attach (GTK_GRID (sbgrid), label, 9, 0, 1, 1);
gtk_widget_show (label);
remaining_label = gtk_label_new ("0");
- gtk_table_attach (GTK_TABLE (sbtbl), remaining_label,
- 10, 11, 0, 1, 0, 0, 3, 3);
+ gtk_grid_attach (GTK_GRID (sbgrid), remaining_label, 10, 0, 1, 1);
gtk_widget_show (remaining_label);
- gtk_widget_show (sbtbl);
+ gtk_widget_show (sbgrid);
statusbar = gtk_statusbar_new ();
- gtk_box_pack_start (GTK_BOX (statusbar), sbtbl, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (statusbar), sbgrid, FALSE, FALSE, 0);
show_both = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]