[dia/dia-next: 24/59] Use GtkGrid instead of GtkTable



commit df90933965f2dba7c005a238f2084480d5c26388
Author: Zander Brown <zbrown gnome org>
Date:   Tue Dec 25 01:45:01 2018 +0000

    Use GtkGrid instead of GtkTable
    
    Fortunatly the API is very similar

 app/dia-props.c                        | 126 ++++++++--------
 app/diapagelayout.c                    | 266 +++++++++++++++++----------------
 app/interface.c                        |  64 ++++----
 app/preferences.c                      |  50 ++++---
 lib/diafontselector.h                  |   1 +
 lib/propdialogs.c                      |  38 ++---
 objects/UML/class_attributes_dialog.c  |  41 +++--
 objects/UML/class_dialog.c             | 100 ++++++++-----
 objects/UML/class_operations_dialog.c  | 113 +++++++++-----
 objects/UML/class_templates_dialog.c   |  28 +++-
 plug-ins/postscript/paginate_psprint.c |  48 +++---
 11 files changed, 481 insertions(+), 394 deletions(-)
---
diff --git a/app/dia-props.c b/app/dia-props.c
index 49aa6ff0..08387b6b 100644
--- a/app/dia-props.c
+++ b/app/dia-props.c
@@ -112,72 +112,68 @@ create_diagram_properties_dialog(Diagram *dia)
   gtk_widget_show(notebook);
 
   /* the grid page */
-  table = gtk_table_new(3,3,FALSE);
-  gtk_container_set_border_width(GTK_CONTAINER(table), 2);
-  gtk_table_set_row_spacings(GTK_TABLE(table), 1);
-  gtk_table_set_col_spacings(GTK_TABLE(table), 2);
+  table = gtk_grid_new ();
+  gtk_container_set_border_width (GTK_CONTAINER (table), 2);
+  gtk_grid_set_row_spacing (GTK_GRID (table), 1);
+  gtk_grid_set_column_spacing (GTK_GRID (table), 2);
 
   dynamic_check = gtk_check_button_new_with_label(_("Dynamic grid"));
-  gtk_table_attach(GTK_TABLE(table), dynamic_check, 1,2, 0,1,
-                  GTK_FILL, GTK_FILL, 0, 0);
+  gtk_grid_attach (GTK_GRID (table), dynamic_check, 1, 0, 1, 1);
   g_signal_connect(G_OBJECT(dynamic_check), "toggled", 
                   G_CALLBACK(diagram_properties_update_sensitivity), NULL);
            
   gtk_widget_show(dynamic_check);
 
-  label = gtk_label_new(_("x"));
-  gtk_table_attach(GTK_TABLE(table), label, 1,2, 1,2,
-                  GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show(label);
-  label = gtk_label_new(_("y"));
-  gtk_table_attach(GTK_TABLE(table), label, 2,3, 1,2,
-                  GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show(label);
+  label = gtk_label_new (_("x"));
+  gtk_grid_attach (GTK_GRID (table), label, 1, 1, 1, 1);
+  gtk_widget_show (label);
+  label = gtk_label_new (_("y"));
+  gtk_grid_attach (GTK_GRID (table), label, 2, 1, 1, 1);
+  gtk_widget_show (label);
 
   label = gtk_label_new(_("Spacing"));
-  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 2,3,
-                  GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show(label);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
+  gtk_widget_show (label);
 
   adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 10.0, 0.1, 10.0, 0));
   width_x_entry = gtk_spin_button_new(adj, 1.0, 3);
   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(width_x_entry), TRUE);
-  gtk_table_attach(GTK_TABLE(table), width_x_entry, 1,2, 2,3,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
-  gtk_widget_show(width_x_entry);
+  gtk_widget_set_hexpand (width_x_entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), width_x_entry, 1, 2, 1, 1);
+  gtk_widget_show (width_x_entry);
 
   adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 10.0, 0.1, 10.0, 0));
   width_y_entry = gtk_spin_button_new(adj, 1.0, 3);
   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(width_y_entry), TRUE);
-  gtk_table_attach(GTK_TABLE(table), width_y_entry, 2,3, 2,3,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
-  gtk_widget_show(width_y_entry);
+  gtk_widget_set_hexpand (width_y_entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), width_y_entry, 2, 2, 1, 1);
+  gtk_widget_show (width_y_entry);
 
   label = gtk_label_new(_("Visible spacing"));
-  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 3,4,
-                  GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show(label);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID(table), label, 0, 3, 1, 1);
+  gtk_widget_show (label);
 
   adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 100.0, 1.0, 10.0, 0));
   visible_x_entry = gtk_spin_button_new(adj, 1.0, 0);
   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(visible_x_entry), TRUE);
-  gtk_table_attach(GTK_TABLE(table), visible_x_entry, 1,2, 3,4,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
-  gtk_widget_show(visible_x_entry);
+  gtk_widget_set_hexpand (visible_x_entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), visible_x_entry, 1, 3, 1, 1);
+  gtk_widget_show (visible_x_entry);
 
   adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 100.0, 1.0, 10.0, 0));
   visible_y_entry = gtk_spin_button_new(adj, 1.0, 0);
   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(visible_y_entry), TRUE);
-  gtk_table_attach(GTK_TABLE(table), visible_y_entry, 2,3, 3,4,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
-  gtk_widget_show(visible_y_entry);
+  gtk_widget_set_hexpand (visible_y_entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), visible_y_entry, 2, 3, 1, 1);
+  gtk_widget_show (visible_y_entry);
 
   /* Hexes! */
   hex_check = gtk_check_button_new_with_label(_("Hex grid"));
-  gtk_table_attach(GTK_TABLE(table), hex_check, 1,2, 4,5,
-                  GTK_FILL, GTK_FILL, 0, 0);
+  gtk_grid_attach (GTK_GRID (table), hex_check, 1, 4, 1, 1);
   g_signal_connect(G_OBJECT(hex_check), "toggled", 
                   G_CALLBACK(diagram_properties_update_sensitivity), NULL);
            
@@ -185,59 +181,55 @@ create_diagram_properties_dialog(Diagram *dia)
 
   label = gtk_label_new(_("Hex grid size"));
   gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 5,6,
-                  GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show(label);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 5, 1, 1);
+  gtk_widget_show (label);
 
   adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 100.0, 1.0, 10.0, 0));
   hex_size_entry = gtk_spin_button_new(adj, 1.0, 0);
   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(hex_size_entry), TRUE);
-  gtk_table_attach(GTK_TABLE(table), hex_size_entry, 1,2, 5,6,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
-  gtk_widget_show(hex_size_entry);
+  gtk_widget_set_hexpand (hex_size_entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), hex_size_entry, 1, 5, 1, 1);
+  gtk_widget_show (hex_size_entry);
 
-  label = gtk_label_new(_("Grid"));
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
-  gtk_widget_show(table);
-  gtk_widget_show(label);
+  label = gtk_label_new (_("Grid"));
+  gtk_notebook_append_page (GTK_NOTEBOOK (notebook), table, label);
+  gtk_widget_show (table);
+  gtk_widget_show (label);
 
   /* The background page */
-  table = gtk_table_new(1,2, FALSE);
-  gtk_container_set_border_width(GTK_CONTAINER(table), 2);
-  gtk_table_set_row_spacings(GTK_TABLE(table), 1);
-  gtk_table_set_col_spacings(GTK_TABLE(table), 2);
+  table = gtk_grid_new ();
+  gtk_container_set_border_width (GTK_CONTAINER (table), 2);
+  gtk_grid_set_row_spacing (GTK_GRID (table), 1);
+  gtk_grid_set_column_spacing (GTK_GRID (table), 2);
 
   label = gtk_label_new(_("Background"));
   gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 0,1,
-                  GTK_FILL, GTK_FILL, 0, 0);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
   gtk_widget_show(label);
 
   bg_colour = dia_color_selector_new();
-  gtk_table_attach(GTK_TABLE(table), bg_colour, 1,2, 0,1,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
-  gtk_widget_show(bg_colour);
+  gtk_widget_set_hexpand (bg_colour, TRUE);
+  gtk_grid_attach (GTK_GRID(table), bg_colour, 1, 0, 1, 1);
+  gtk_widget_show (bg_colour);
 
   label = gtk_label_new(_("Grid Lines"));
-  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 1,2,
-                  GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show(label);
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
+  gtk_widget_show (label);
 
   grid_colour = dia_color_selector_new();
-  gtk_table_attach(GTK_TABLE(table), grid_colour, 1,2, 1,2,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
-  gtk_widget_show(grid_colour);
+  gtk_widget_set_hexpand (grid_colour, TRUE);
+  gtk_grid_attach (GTK_GRID (table), grid_colour, 1, 1, 1, 1);
+  gtk_widget_show (grid_colour);
 
   label = gtk_label_new(_("Page Breaks"));
   gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), label, 0,1, 2,3,
-                  GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show(label);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
+  gtk_widget_show (label);
 
   pagebreak_colour = dia_color_selector_new();
-  gtk_table_attach(GTK_TABLE(table), pagebreak_colour, 1,2, 2,3,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
+  gtk_widget_set_hexpand (pagebreak_colour, TRUE);
+  gtk_grid_attach (GTK_GRID (table), pagebreak_colour, 1, 2, 1, 1);
   gtk_widget_show(pagebreak_colour);
 
   label = gtk_label_new(_("Colors"));
diff --git a/app/diapagelayout.c b/app/diapagelayout.c
index 3db63aca..40d74a31 100644
--- a/app/diapagelayout.c
+++ b/app/diapagelayout.c
@@ -47,7 +47,7 @@
 typedef struct _DiaPageLayoutClass DiaPageLayoutClass;
 
 struct _DiaPageLayout {
-  GtkTable parent;
+  GtkGrid parent;
 
   /*<private>*/
   GtkWidget *paper_size, *paper_label;
@@ -68,7 +68,7 @@ struct _DiaPageLayout {
 };
 
 struct _DiaPageLayoutClass {
-  GtkTableClass parent_class;
+  GtkGridClass parent_class;
 
   void (*changed)(DiaPageLayout *pl);
 };
@@ -103,7 +103,7 @@ dia_page_layout_get_type(void)
       0,               /* n_preallocs */
       (GInstanceInitFunc) dia_page_layout_init,
     };
-    pl_type = g_type_register_static (gtk_table_get_type (), "DiaPageLayout", &pl_info, 0);
+    pl_type = g_type_register_static (GTK_TYPE_GRID, "DiaPageLayout", &pl_info, 0);
   }
   return pl_type;
 }
@@ -148,23 +148,21 @@ dia_page_layout_init(DiaPageLayout *self)
   GList *paper_names;
   gint i;
 
-  gtk_table_resize(GTK_TABLE(self), 3, 2);
-  gtk_table_set_row_spacings(GTK_TABLE(self), 5);
-  gtk_table_set_col_spacings(GTK_TABLE(self), 5);
+  gtk_grid_set_row_spacing (GTK_GRID (self), 5);
+  gtk_grid_set_column_spacing (GTK_GRID (self), 5);
 
   /* paper size */
-  frame = gtk_frame_new(_("Paper Size"));
-  gtk_table_attach(GTK_TABLE(self), frame, 0,1, 0,1,
-                  GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show(frame);
+  frame = gtk_frame_new (_("Paper Size"));
+  gtk_grid_attach (GTK_GRID (self), frame, 0, 0, 1, 1);
+  gtk_widget_show (frame);
 
   box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
   gtk_container_set_border_width(GTK_CONTAINER(box), 5);
   gtk_container_add(GTK_CONTAINER(frame), box);
   gtk_widget_show(box);
 
-  self->paper_size = dia_option_menu_new();
-  gtk_box_pack_start(GTK_BOX(box), self->paper_size, TRUE, FALSE, 0);
+  self->paper_size = dia_option_menu_new ();
+  gtk_box_pack_start (GTK_BOX (box), self->paper_size, TRUE, FALSE, 0);
 
   g_signal_connect (self->paper_size, "changed", 
                    G_CALLBACK(paper_size_change), self);
@@ -182,10 +180,10 @@ dia_page_layout_init(DiaPageLayout *self)
   gtk_widget_show(self->paper_label);
 
   /* orientation */
-  frame = gtk_frame_new(_("Orientation"));
-  gtk_table_attach(GTK_TABLE(self), frame, 1,2, 0,1,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
-  gtk_widget_show(frame);
+  frame = gtk_frame_new (_("Orientation"));
+  gtk_widget_set_hexpand (frame, TRUE);
+  gtk_grid_attach (GTK_GRID (self), frame, 1, 0, 1, 1);
+  gtk_widget_show (frame);
 
   box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
   gtk_container_set_border_width(GTK_CONTAINER(box), 5);
@@ -211,124 +209,134 @@ dia_page_layout_init(DiaPageLayout *self)
   gtk_widget_show(self->orient_landscape);
 
   /* margins */
-  frame = gtk_frame_new(_("Margins"));
-  gtk_table_attach(GTK_TABLE(self), frame, 0,1, 1,2,
-                  GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show(frame);
-
-  table = gtk_table_new(4, 2, FALSE);
-  gtk_container_set_border_width(GTK_CONTAINER(table), 5);
-  gtk_table_set_row_spacings(GTK_TABLE(table), 5);
-  gtk_table_set_col_spacings(GTK_TABLE(table), 5);
+  frame = gtk_frame_new (_("Margins"));
+  gtk_grid_attach (GTK_GRID (self), frame, 0, 1, 1, 1);
+  gtk_widget_show (frame);
+
+  table = gtk_grid_new ();
+  gtk_container_set_border_width (GTK_CONTAINER (table), 5);
+  gtk_grid_set_row_spacing (GTK_GRID (table), 5);
+  gtk_grid_set_column_spacing (GTK_GRID (table), 5);
   gtk_container_add(GTK_CONTAINER(frame), table);
   gtk_widget_show(table);
 
-  wid = gtk_label_new(_("Top:"));
-  gtk_misc_set_alignment(GTK_MISC(wid), 1.0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), wid, 0,1, 0,1,
-                  GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(wid);
-
-  self->tmargin = dia_unit_spinner_new(
-       GTK_ADJUSTMENT(gtk_adjustment_new(1, 0,100, 0.1,10,0)),
-       prefs_get_length_unit());
-  gtk_table_attach(GTK_TABLE(table), self->tmargin, 1,2, 0,1,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(self->tmargin);
-
-  wid = gtk_label_new(_("Bottom:"));
-  gtk_misc_set_alignment(GTK_MISC(wid), 1.0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), wid, 0,1, 1,2,
-                  GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(wid);
-
-  self->bmargin = dia_unit_spinner_new(
-       GTK_ADJUSTMENT(gtk_adjustment_new(1, 0,100, 0.1,10,0)),
-       prefs_get_length_unit());
-  gtk_table_attach(GTK_TABLE(table), self->bmargin, 1,2, 1,2,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(self->bmargin);
-
-  wid = gtk_label_new(_("Left:"));
-  gtk_misc_set_alignment(GTK_MISC(wid), 1.0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), wid, 0,1, 2,3,
-                  GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(wid);
-
-  self->lmargin = dia_unit_spinner_new(
-       GTK_ADJUSTMENT(gtk_adjustment_new(1, 0,100, 0.1,10,0)),
-       prefs_get_length_unit());
-  gtk_table_attach(GTK_TABLE(table), self->lmargin, 1,2, 2,3,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(self->lmargin);
-
-  wid = gtk_label_new(_("Right:"));
-  gtk_misc_set_alignment(GTK_MISC(wid), 1.0, 0.5);
-  gtk_table_attach(GTK_TABLE(table), wid, 0,1, 3,4,
-                  GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(wid);
-
-  self->rmargin = dia_unit_spinner_new(
-       GTK_ADJUSTMENT(gtk_adjustment_new(1, 0,100, 0.1,10,0)),
-       prefs_get_length_unit());
-  gtk_table_attach(GTK_TABLE(table), self->rmargin, 1,2, 3,4,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(self->rmargin);
+  wid = gtk_label_new (_("Top:"));
+  gtk_label_set_xalign (GTK_LABEL (wid), 1.0);
+  gtk_label_set_yalign (GTK_LABEL (wid), 0.5);
+  gtk_widget_set_vexpand (wid, TRUE);
+  gtk_grid_attach (GTK_GRID (table), wid, 0, 0, 1, 1);
+  gtk_widget_show (wid);
+
+  self->tmargin = dia_unit_spinner_new (
+    GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 100, 0.1, 10, 0)),
+    prefs_get_length_unit());
+  gtk_widget_set_vexpand (self->tmargin, TRUE);
+  gtk_widget_set_hexpand (self->tmargin, TRUE);
+  gtk_grid_attach (GTK_GRID (table), self->tmargin, 1, 0, 1, 1);
+  gtk_widget_show (self->tmargin);
+
+  wid = gtk_label_new (_("Bottom:"));
+  gtk_label_set_xalign (GTK_LABEL (wid), 1.0);
+  gtk_label_set_yalign (GTK_LABEL (wid), 0.5);
+  gtk_widget_set_vexpand (wid, TRUE);
+  gtk_grid_attach (GTK_GRID (table), wid, 0, 1, 1, 1);
+  gtk_widget_show (wid);
+
+  self->bmargin = dia_unit_spinner_new (
+    GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 100, 0.1, 10, 0)),
+    prefs_get_length_unit());
+  gtk_widget_set_vexpand (self->bmargin, TRUE);
+  gtk_widget_set_hexpand (self->bmargin, TRUE);
+  gtk_grid_attach (GTK_GRID (table), self->bmargin, 1, 1, 1, 1);
+  gtk_widget_show (self->bmargin);
+
+  wid = gtk_label_new (_("Left:"));
+  gtk_label_set_xalign (GTK_LABEL (wid), 1.0);
+  gtk_label_set_yalign (GTK_LABEL (wid), 0.5);
+  gtk_widget_set_vexpand (wid, TRUE);
+  gtk_grid_attach (GTK_GRID (table), wid, 0, 2, 1, 1);
+  gtk_widget_show (wid);
+
+  self->lmargin = dia_unit_spinner_new (
+    GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 100, 0.1, 10, 0)),
+    prefs_get_length_unit());
+  gtk_widget_set_vexpand (self->lmargin, TRUE);
+  gtk_widget_set_hexpand (self->lmargin, TRUE);
+  gtk_grid_attach (GTK_GRID (table), self->lmargin, 1, 2, 1, 1);
+  gtk_widget_show (self->lmargin);
+
+  wid = gtk_label_new (_("Right:"));
+  gtk_label_set_xalign (GTK_LABEL (wid), 1.0);
+  gtk_label_set_yalign (GTK_LABEL (wid), 0.5);
+  gtk_widget_set_vexpand (wid, TRUE);
+  gtk_grid_attach (GTK_GRID (table), wid, 0, 3, 1, 1);
+  gtk_widget_show (wid);
+
+  self->rmargin = dia_unit_spinner_new (
+    GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 100, 0.1, 10,0)),
+    prefs_get_length_unit());
+  gtk_widget_set_vexpand (self->rmargin, TRUE);
+  gtk_widget_set_hexpand (self->rmargin, TRUE);
+  gtk_grid_attach (GTK_GRID (table), self->rmargin, 1, 3, 1, 1);
+  gtk_widget_show (self->rmargin);
 
   /* Scaling */
-  frame = gtk_frame_new(_("Scaling"));
-  gtk_table_attach(GTK_TABLE(self), frame, 0,1, 2,3,
-                  GTK_FILL, GTK_FILL, 0, 0);
-  gtk_widget_show(frame);
-
-  table = gtk_table_new(2, 4, FALSE);
-  gtk_container_set_border_width(GTK_CONTAINER(table), 5);
-  gtk_table_set_row_spacings(GTK_TABLE(table), 5);
-  gtk_container_add(GTK_CONTAINER(frame), table);
-  gtk_widget_show(table);
-
-  self->scale = gtk_radio_button_new_with_label(NULL, _("Scale:"));
-  gtk_table_attach(GTK_TABLE(table), self->scale, 0,1, 0,1,
-                  GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(self->scale);
-
-  self->scaling = gtk_spin_button_new(
-       GTK_ADJUSTMENT(gtk_adjustment_new(100,1,10000, 1,10,0)), 1, 0);
-  gtk_table_attach(GTK_TABLE(table), self->scaling, 1,4, 0,1,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(self->scaling);
-
-  self->fitto = gtk_radio_button_new_with_label(
-                       gtk_radio_button_get_group(GTK_RADIO_BUTTON(self->scale)), _("Fit to:"));
-  gtk_table_attach(GTK_TABLE(table), self->fitto, 0,1, 1,2,
-                  GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(self->fitto);
-
-  self->fitw = gtk_spin_button_new(
-       GTK_ADJUSTMENT(gtk_adjustment_new(1, 1, 1000, 1, 10, 0)), 1, 0);
-  gtk_widget_set_sensitive(self->fitw, FALSE);
-  gtk_table_attach(GTK_TABLE(table), self->fitw, 1,2, 1,2,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(self->fitw);
-
-  wid = gtk_label_new(_("by"));
-  gtk_misc_set_padding(GTK_MISC(wid), 5, 0);
-  gtk_table_attach(GTK_TABLE(table), wid, 2,3, 1,2,
-                  GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(wid);
-
-  self->fith = gtk_spin_button_new(
-       GTK_ADJUSTMENT(gtk_adjustment_new(1, 1, 1000, 1, 10, 0)), 1, 0);
-  gtk_widget_set_sensitive(self->fith, FALSE);
-  gtk_table_attach(GTK_TABLE(table), self->fith, 3,4, 1,2,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(self->fith);
+  frame = gtk_frame_new (_("Scaling"));
+  gtk_grid_attach (GTK_GRID (self), frame, 0, 2, 1, 1);
+  gtk_widget_show (frame);
+
+  table = gtk_grid_new ();
+  gtk_container_set_border_width (GTK_CONTAINER (table), 5);
+  gtk_grid_set_row_spacing (GTK_GRID (table), 5);
+  gtk_container_add (GTK_CONTAINER (frame), table);
+  gtk_widget_show (table);
+
+  self->scale = gtk_radio_button_new_with_label (NULL, _("Scale:"));
+  gtk_widget_set_vexpand (self->scale, TRUE);
+  gtk_grid_attach (GTK_GRID (table), self->scale, 0, 0, 1, 1);
+  gtk_widget_show (self->scale);
+
+  self->scaling = gtk_spin_button_new (
+    GTK_ADJUSTMENT (gtk_adjustment_new (100, 1, 10000, 1, 10, 0)), 1, 0);
+  gtk_widget_set_vexpand (self->scaling, TRUE);
+  gtk_widget_set_hexpand (self->scaling, TRUE);
+  gtk_grid_attach (GTK_GRID (table), self->scaling, 1, 0, 3, 1);
+  gtk_widget_show (self->scaling);
+
+  self->fitto = gtk_radio_button_new_with_label (
+    gtk_radio_button_get_group (GTK_RADIO_BUTTON (self->scale)), _("Fit to:"));
+  gtk_widget_set_vexpand (self->fitto, TRUE);
+  gtk_grid_attach (GTK_GRID (table), self->fitto, 0, 1, 1, 1);
+  gtk_widget_show (self->fitto);
+
+  self->fitw = gtk_spin_button_new (
+    GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 1000, 1, 10, 0)), 1, 0);
+  gtk_widget_set_sensitive (self->fitw, FALSE);
+  gtk_widget_set_vexpand (self->fitw, TRUE);
+  gtk_widget_set_hexpand (self->fitw, TRUE);
+  gtk_grid_attach (GTK_GRID (table), self->fitw, 1, 1, 1, 1);
+  gtk_widget_show (self->fitw);
+
+  wid = gtk_label_new (_("by"));
+  gtk_misc_set_padding (GTK_MISC (wid), 5, 0);
+  gtk_widget_set_vexpand (wid, TRUE);
+  gtk_grid_attach (GTK_GRID (table), wid, 2, 1, 1, 1);
+  gtk_widget_show (wid);
+
+  self->fith = gtk_spin_button_new (
+    GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 1000, 1, 10, 0)), 1, 0);
+  gtk_widget_set_sensitive (self->fith, FALSE);
+  gtk_widget_set_vexpand (self->fith, TRUE);
+  gtk_widget_set_hexpand (self->fith, TRUE);
+  gtk_grid_attach (GTK_GRID (table), self->fith, 3, 1, 1, 1);
+  gtk_widget_show (self->fith);
 
   /* the drawing area */
-  self->darea = gtk_drawing_area_new();
-  gtk_table_attach(GTK_TABLE(self), self->darea, 1,2, 1,3,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(self->darea);
+  self->darea = gtk_drawing_area_new ();
+  gtk_widget_set_vexpand (self->darea, TRUE);
+  gtk_widget_set_hexpand (self->darea, TRUE);
+  gtk_grid_attach (GTK_GRID (self), self->darea, 1, 1, 1, 2);
+  gtk_widget_show (self->darea);
 
   /* connect the signal handlers */
   g_signal_connect_swapped(G_OBJECT(self->orient_portrait), "toggled",
@@ -604,13 +612,9 @@ darea_size_allocate(DiaPageLayout *self, GtkAllocation *allocation)
 static gint
 darea_draw (DiaPageLayout *self, cairo_t *ctx)
 {
-  GdkWindow *window = gtk_widget_get_window(self->darea);
   gfloat val;
   gint num;
 
-  if (!window)
-    return FALSE;
-
   cairo_set_line_cap (ctx, CAIRO_LINE_CAP_SQUARE);
   cairo_set_line_width (ctx, 1);
   cairo_set_antialias (ctx, CAIRO_ANTIALIAS_NONE);
diff --git a/app/interface.c b/app/interface.c
index 754f2234..89c43929 100644
--- a/app/interface.c
+++ b/app/interface.c
@@ -505,10 +505,10 @@ _ddisplay_setup_rulers (DDisplay *ddisp, GtkWidget *shell, GtkWidget *table)
   ddisp->vrule = dia_ruler_new (GTK_ORIENTATION_VERTICAL, shell, ddisp);
 
   /* harder to change position in the table, but we did not do it for years ;) */
-  gtk_table_attach (GTK_TABLE (table), ddisp->hrule, 1, 2, 0, 1,
-                    GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_table_attach (GTK_TABLE (table), ddisp->vrule, 0, 1, 1, 2,
-                    GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
+  gtk_widget_set_hexpand (ddisp->hrule, TRUE);
+  gtk_grid_attach (GTK_GRID (table), ddisp->hrule, 1, 0, 1, 1);
+  gtk_widget_set_vexpand (ddisp->vrule, TRUE);
+  gtk_grid_attach (GTK_GRID (table), ddisp->vrule, 0, 1, 1, 1);
 }
 static void
 _ddisplay_setup_events (DDisplay *ddisp, GtkWidget *shell)
@@ -546,10 +546,10 @@ _ddisplay_setup_scrollbars (DDisplay *ddisp, GtkWidget *table, int width, int he
                    G_CALLBACK(ddisplay_vsb_update), ddisp);
 
   /* harder to change position in the table, but we did not do it for years ;) */
-  gtk_table_attach (GTK_TABLE (table), ddisp->hsb, 0, 2, 2, 3,
-                    GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
-  gtk_table_attach (GTK_TABLE (table), ddisp->vsb, 2, 3, 0, 2,
-                    GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
+  gtk_widget_set_hexpand (ddisp->hsb, TRUE);
+  gtk_grid_attach (GTK_GRID (table), ddisp->hsb, 0, 2, 2, 1);
+  gtk_widget_set_vexpand (ddisp->vsb, TRUE);
+  gtk_grid_attach (GTK_GRID (table), ddisp->vsb, 2, 0, 1, 2);
 
   gtk_widget_show (ddisp->hsb);
   gtk_widget_show (ddisp->vsb);
@@ -565,13 +565,14 @@ _ddisplay_setup_navigation (DDisplay *ddisp, GtkWidget *table, gboolean top_left
                        _("Pops up the Navigation window."));
   gtk_widget_show(navigation_button);
 
+  gtk_widget_set_halign (GTK_WIDGET (navigation_button), GTK_ALIGN_FILL);
+  gtk_widget_set_valign (GTK_WIDGET (navigation_button), GTK_ALIGN_FILL);
+
   /* harder to change position in the table, but we did not do it for years ;) */
   if (top_left)
-    gtk_table_attach (GTK_TABLE (table), navigation_button, 0, 1, 0, 1,
-                      GTK_FILL, GTK_FILL, 0, 0);
+    gtk_grid_attach (GTK_GRID (table), navigation_button, 0, 0, 1, 1);
   else
-    gtk_table_attach (GTK_TABLE (table), navigation_button, 2, 3, 2, 3,
-                      GTK_FILL, GTK_FILL, 0, 0);
+    gtk_grid_attach (GTK_GRID (table), navigation_button, 2, 2, 1, 1);
   if (!ddisp->origin)
     ddisp->origin = g_object_ref (navigation_button);
 }
@@ -639,14 +640,12 @@ use_integrated_ui_for_display_shell(DDisplay *ddisp, char *title)
   g_object_set_data (G_OBJECT (ddisp->container), "window",    ui.main_window);
 
   /*  the table containing all widgets  */
-  table = gtk_table_new (3, 3, FALSE);
-  gtk_table_set_col_spacing (GTK_TABLE (table), 0, 1);
-  gtk_table_set_col_spacing (GTK_TABLE (table), 1, 2);
-  gtk_table_set_row_spacing (GTK_TABLE (table), 0, 1);
-  gtk_table_set_row_spacing (GTK_TABLE (table), 1, 2);
+  table = gtk_grid_new ();
+  gtk_grid_set_column_spacing (GTK_GRID (table), 2);
+  gtk_grid_set_row_spacing (GTK_GRID (table), 2);
   gtk_container_set_border_width (GTK_CONTAINER (table), 2);
 
-  gtk_box_pack_start( GTK_BOX(ddisp->container), table, TRUE, TRUE, 0 );
+  gtk_box_pack_start (GTK_BOX (ddisp->container), table, TRUE, TRUE, 0);
 
   /*  scrollbars, rulers, canvas, menu popup button  */
   ddisp->origin = NULL;
@@ -662,9 +661,9 @@ use_integrated_ui_for_display_shell(DDisplay *ddisp, char *title)
   ddisp->canvas = create_canvas (ddisp);
 
   /*  place all remaining widgets (no 'origin' anymore, since navigation is top-left */
-  gtk_table_attach (GTK_TABLE (table), ddisp->canvas, 1, 2, 1, 2,
-                    GTK_EXPAND | GTK_SHRINK | GTK_FILL,
-                    GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
+  gtk_widget_set_hexpand (ddisp->canvas, TRUE);
+  gtk_widget_set_vexpand (ddisp->canvas, TRUE);
+  gtk_grid_attach (GTK_GRID (table), ddisp->canvas, 1, 1, 1, 1);
 
   ddisp->common_toolbar = ui.toolbar;
   /* Stand-alone window menubar */
@@ -751,11 +750,9 @@ create_display_shell(DDisplay *ddisp,
                    G_CALLBACK (ddisplay_destroy), ddisp);
 
   /*  the table containing all widgets  */
-  table = gtk_table_new (4, 3, FALSE);
-  gtk_table_set_col_spacing (GTK_TABLE (table), 0, 1);
-  gtk_table_set_col_spacing (GTK_TABLE (table), 1, 2);
-  gtk_table_set_row_spacing (GTK_TABLE (table), 0, 1);
-  gtk_table_set_row_spacing (GTK_TABLE (table), 1, 2);
+  table = gtk_grid_new ();
+  gtk_grid_set_column_spacing (GTK_GRID (table), 2);
+  gtk_grid_set_row_spacing (GTK_GRID (table), 2);
   gtk_container_set_border_width (GTK_CONTAINER (table), 2);
   if (use_mbar) 
   {
@@ -792,11 +789,11 @@ create_display_shell(DDisplay *ddisp,
   ddisp->canvas = create_canvas (ddisp);
 
   /*  pack all remaining widgets  */
-  gtk_table_attach (GTK_TABLE (table), ddisp->origin, 0, 1, 0, 1,
-                    GTK_FILL, GTK_FILL, 0, 0);
-  gtk_table_attach (GTK_TABLE (table), ddisp->canvas, 1, 2, 1, 2,
-                    GTK_EXPAND | GTK_SHRINK | GTK_FILL,
-                    GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
+  gtk_grid_attach (GTK_GRID (table), ddisp->origin, 0, 0, 1, 1);
+  gtk_widget_set_hexpand (ddisp->canvas, TRUE);
+  gtk_widget_set_vexpand (ddisp->canvas, TRUE);
+  gtk_grid_attach (GTK_GRID (table), ddisp->canvas, 1, 1, 1, 1);
+
 
   /* TODO rob use per window accel */
   ddisp->accel_group = menus_get_display_accels ();
@@ -851,8 +848,9 @@ create_display_shell(DDisplay *ddisp,
   gtk_box_pack_start (GTK_BOX (status_hbox), ddisp->modified_status,
                      TRUE, TRUE, 0);
 
-  gtk_table_attach (GTK_TABLE (table), status_hbox, 0, 3, 3, 4,
-                    GTK_FILL, GTK_FILL, 0, 0);
+  gtk_widget_set_halign (GTK_WIDGET (status_hbox), GTK_ALIGN_FILL);
+  gtk_widget_set_valign (GTK_WIDGET (status_hbox), GTK_ALIGN_FILL);
+  gtk_grid_attach (GTK_GRID (table), status_hbox, 0, 3, 3, 1);
 
   display_rulers_show (ddisp);
   gtk_widget_show (ddisp->zoom_status);
diff --git a/app/preferences.c b/app/preferences.c
index 3eca6e08..eed691ea 100644
--- a/app/preferences.c
+++ b/app/preferences.c
@@ -101,7 +101,7 @@ static const char *default_favored_filter = N_("any");
 
 struct DiaPrefsTab {
   char *title;
-  GtkTable *table;
+  GtkGrid *table;
   int row;
 };
 
@@ -564,8 +564,8 @@ prefs_create_dialog(void)
   GtkWidget *label;
   GtkWidget *dialog_vbox;
   GtkWidget *notebook;
-  GtkTable *top_table = NULL; /* top level table for the tab */
-  GtkTable *current_table = NULL;
+  GtkGrid *top_table = NULL; /* top level table for the tab */
+  GtkGrid *current_table = NULL;
   int i;
   int tab_idx = -1;
 
@@ -608,10 +608,10 @@ prefs_create_dialog(void)
     label = gtk_label_new(gettext(prefs_tabs[i].title));
     gtk_widget_show(label);
 
-    table = gtk_table_new (9, 2, FALSE);
-    prefs_tabs[i].table = GTK_TABLE(table);
-    gtk_widget_set_size_request(table, -1, -1);
-    gtk_widget_show(table);
+    table = gtk_grid_new ();
+    prefs_tabs[i].table = GTK_GRID (table);
+    gtk_widget_set_size_request (table, -1, -1);
+    gtk_widget_show (table);
     
 #ifdef SCROLLED_PAGES
     notebook_page = gtk_scrolled_window_new (NULL, NULL);
@@ -652,12 +652,13 @@ prefs_create_dialog(void)
     case PREF_NONE:
       widget = gtk_frame_new(gettext(prefs_data[i].label_text));
       gtk_widget_show (widget);
-      gtk_table_attach (current_table, widget, 0, 2,
-                       row, row + 1,
-                       GTK_FILL | GTK_EXPAND, GTK_FILL, 1, 1);
-      current_table = GTK_TABLE(gtk_table_new (9, 2, FALSE));
-      gtk_container_add(GTK_CONTAINER(widget), GTK_WIDGET(current_table));
-      gtk_widget_show(GTK_WIDGET(current_table));
+      gtk_widget_set_halign (GTK_WIDGET (widget), GTK_ALIGN_FILL);
+      gtk_widget_set_hexpand (GTK_WIDGET (widget), TRUE);
+      gtk_widget_set_valign (GTK_WIDGET (widget), GTK_ALIGN_FILL);
+      gtk_grid_attach (current_table, widget, 0, row, 2, 1);
+      current_table = GTK_GRID (gtk_grid_new ());
+      gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (current_table));
+      gtk_widget_show (GTK_WIDGET (current_table));
       break;
     case PREF_END_GROUP:
       current_table = top_table;
@@ -665,24 +666,27 @@ prefs_create_dialog(void)
     case PREF_BOOLEAN:
       widget = gtk_check_button_new_with_label (gettext(prefs_data[i].label_text));
       gtk_widget_show (widget);
-      gtk_table_attach (current_table, widget, 0, 2,
-                       row, row + 1,
-                       GTK_FILL | GTK_EXPAND, GTK_FILL, 1, 1);
+      gtk_widget_set_halign (GTK_WIDGET (widget), GTK_ALIGN_FILL);
+      gtk_widget_set_hexpand (GTK_WIDGET (widget), TRUE);
+      gtk_widget_set_valign (GTK_WIDGET (widget), GTK_ALIGN_FILL);
+      gtk_grid_attach (current_table, widget, 0, row, 2, 1);
       break;
     default:
       label = gtk_label_new (gettext(prefs_data[i].label_text));
-      gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.3);
+      gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+      gtk_label_set_yalign (GTK_LABEL (label), 0.3);
       gtk_widget_show (label);
       
-      gtk_table_attach (current_table, label, 0, 1,
-                       row, row + 1,
-                       GTK_FILL | GTK_EXPAND, GTK_FILL, 1, 1);
+      gtk_widget_set_halign (GTK_WIDGET (label), GTK_ALIGN_FILL);
+      gtk_widget_set_hexpand (GTK_WIDGET (label), TRUE);
+      gtk_widget_set_valign (GTK_WIDGET (label), GTK_ALIGN_FILL);
+      gtk_grid_attach (current_table, label, 0, row, 1, 1);
       
       widget = prefs_get_property_widget(&prefs_data[i]);
       if (widget != NULL) {
-       gtk_table_attach (current_table, widget, 1, 2,
-                         row, row + 1,
-                         GTK_FILL, GTK_FILL, 1, 1);
+        gtk_widget_set_halign (GTK_WIDGET (widget), GTK_ALIGN_FILL);
+        gtk_widget_set_valign (GTK_WIDGET (widget), GTK_ALIGN_FILL);
+        gtk_grid_attach (current_table, widget, 1, row, 1, 1);
       }
       break;
     }
diff --git a/lib/diafontselector.h b/lib/diafontselector.h
index 196b4cc6..69e42aae 100644
--- a/lib/diafontselector.h
+++ b/lib/diafontselector.h
@@ -26,6 +26,7 @@
 G_DECLARE_FINAL_TYPE (DiaFontSelector, dia_font_selector, DIA, FONT_SELECTOR, GtkFontButton)
 
 struct _DiaFontSelector {
+       GtkFontButton parent;
 };
 
 GtkWidget* dia_font_selector_new             (void);
diff --git a/lib/propdialogs.c b/lib/propdialogs.c
index e25f6ab8..d81168e6 100644
--- a/lib/propdialogs.c
+++ b/lib/propdialogs.c
@@ -112,9 +112,9 @@ prop_dialog_add_raw_with_flags(PropDialog *dialog, GtkWidget *widget,
 static void
 prop_dialog_make_curtable(PropDialog *dialog) 
 {
-  GtkWidget *table = gtk_table_new(1,2,FALSE);  
-  gtk_table_set_row_spacings(GTK_TABLE(table), 2);
-  gtk_table_set_col_spacings(GTK_TABLE(table), 5);
+  GtkWidget *table = gtk_grid_new ();  
+  gtk_grid_set_row_spacing (GTK_GRID (table), 2);
+  gtk_grid_set_column_spacing (GTK_GRID (table), 5);
   gtk_widget_show(table);
   prop_dialog_add_raw(dialog,table);
 
@@ -125,21 +125,25 @@ prop_dialog_make_curtable(PropDialog *dialog)
 static void
 prop_dialog_add_widget(PropDialog *dialog, GtkWidget *label, GtkWidget *widget)
 {
-  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-
   if (!dialog->curtable) prop_dialog_make_curtable(dialog);
-  gtk_table_attach(GTK_TABLE(dialog->curtable),label, 
-                   0,1,
-                   dialog->currow, dialog->currow+1,
-                   GTK_FILL, GTK_FILL|GTK_EXPAND,
-                   0,0);
-  gtk_table_attach(GTK_TABLE(dialog->curtable),widget, 
-                   1,2,
-                   dialog->currow, dialog->currow+1,
-                   GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND,
-                   0,0);
-  gtk_widget_show(label);
-  gtk_widget_show(widget);
+
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_widget_set_vexpand (GTK_WIDGET (label), TRUE);
+  gtk_widget_set_halign (GTK_WIDGET (label), GTK_ALIGN_FILL);
+  gtk_widget_set_valign (GTK_WIDGET (label), GTK_ALIGN_FILL);
+  gtk_grid_attach (GTK_GRID (dialog->curtable), label, 
+                   0, dialog->currow, 1, 1);
+  
+  gtk_widget_set_hexpand (GTK_WIDGET (widget), TRUE);
+  gtk_widget_set_vexpand (GTK_WIDGET (widget), TRUE);
+  gtk_widget_set_halign (GTK_WIDGET (widget), GTK_ALIGN_FILL);
+  gtk_widget_set_valign (GTK_WIDGET (widget), GTK_ALIGN_FILL);
+  gtk_grid_attach (GTK_GRID (dialog->curtable), widget, 
+                   1, dialog->currow, 1, 1);
+
+  gtk_widget_show (label);
+  gtk_widget_show (widget);
   dialog->currow++;
 }
 
diff --git a/objects/UML/class_attributes_dialog.c b/objects/UML/class_attributes_dialog.c
index 35a7bde8..bed1700a 100644
--- a/objects/UML/class_attributes_dialog.c
+++ b/objects/UML/class_attributes_dialog.c
@@ -508,7 +508,7 @@ _attributes_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
   gtk_widget_show(frame);
   gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
 
-  table = gtk_table_new (5, 2, FALSE);
+  table = gtk_grid_new ();
   gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
 
   label = gtk_label_new(_("Name:"));
@@ -518,9 +518,11 @@ _attributes_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
                    G_CALLBACK (attributes_update_event), umlclass);
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (attributes_update), umlclass);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,0,1, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,0,1, GTK_FILL | GTK_EXPAND,0, 0,2);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
+  gtk_widget_set_hexpand (entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 0, 1, 1);
 
   label = gtk_label_new(_("Type:"));
   entry = gtk_entry_new();
@@ -529,9 +531,11 @@ _attributes_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
                    G_CALLBACK (attributes_update_event), umlclass);
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (attributes_update), umlclass);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,1,2, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,1,2, GTK_FILL | GTK_EXPAND,0, 0,2);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
+  gtk_widget_set_hexpand (entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 1, 1, 1);
 
   label = gtk_label_new(_("Value:"));
   entry = gtk_entry_new();
@@ -540,9 +544,11 @@ _attributes_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
                    G_CALLBACK (attributes_update_event), umlclass);
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (attributes_update), umlclass);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,2,3, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,2,3, GTK_FILL | GTK_EXPAND,0, 0,2);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
+  gtk_widget_set_hexpand (entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 2, 1, 1);
 
   label = gtk_label_new(_("Comment:"));
   scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
@@ -561,9 +567,11 @@ _attributes_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (attributes_update), umlclass);
 #endif
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,3,4, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), scrolledwindow, 1,2,3,4, GTK_FILL | GTK_EXPAND,0, 0,2);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1);
+  gtk_widget_set_hexpand (entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), scrolledwindow, 1, 3, 1, 1);
 
 
   label = gtk_label_new(_("Visibility:"));
@@ -580,9 +588,10 @@ _attributes_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
     GtkWidget * align;
     align = gtk_alignment_new(0.0, 0.5, 0.0, 0.0);
     gtk_container_add(GTK_CONTAINER(align), omenu);
-    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-    gtk_table_attach (GTK_TABLE (table), label, 0,1,4,5, GTK_FILL,0, 0,3);
-    gtk_table_attach (GTK_TABLE (table), align, 1,2,4,5, GTK_FILL,0, 0,3);
+    gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+    gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+    gtk_grid_attach (GTK_GRID (table), label, 0, 4, 1, 1);
+    gtk_grid_attach (GTK_GRID (table), align, 1, 4, 1, 1);
   }
 
   hbox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
diff --git a/objects/UML/class_dialog.c b/objects/UML/class_dialog.c
index 2e3b0b2d..f6b744f4 100644
--- a/objects/UML/class_dialog.c
+++ b/objects/UML/class_dialog.c
@@ -274,7 +274,7 @@ class_fill_in_dialog(UMLClass *umlclass)
 }
 
 static void
-create_font_props_row (GtkTable   *table,
+create_font_props_row (GtkGrid    *table,
                        const char *kind,
                        gint        row,
                        DiaFont    *font,
@@ -288,15 +288,15 @@ create_font_props_row (GtkTable   *table,
   label = gtk_label_new (kind);
   gtk_label_set_xalign (GTK_LABEL (label), 0.0);
   gtk_label_set_yalign (GTK_LABEL (label), 0.5);
-  gtk_table_attach_defaults (table, label, 0, 1, row, row+1);
+  gtk_grid_attach (table, label, 0, row, 1, 1);
   *fontsel = DIA_FONT_SELECTOR (dia_font_selector_new ());
   dia_font_selector_set_font (DIA_FONT_SELECTOR (*fontsel), font);
-  gtk_table_attach_defaults (GTK_TABLE (table), GTK_WIDGET(*fontsel), 1, 2, row, row+1);
+  gtk_grid_attach (GTK_GRID (table), GTK_WIDGET(*fontsel), 1, row, 1, 1);
 
   adj = gtk_adjustment_new (height, 0.1, 10.0, 0.1, 1.0, 0);
   *heightsel = GTK_SPIN_BUTTON (gtk_spin_button_new (GTK_ADJUSTMENT(adj), 1.0, 2));
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (*heightsel), TRUE);
-  gtk_table_attach_defaults (table, GTK_WIDGET (*heightsel), 2, 3, row, row+1);
+  gtk_grid_attach (table, GTK_WIDGET (*heightsel), 2, row, 1, 1);
 }
 
 static void 
@@ -322,29 +322,35 @@ class_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
   vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
   
-  table = gtk_table_new (3, 2, FALSE);
+  table = gtk_grid_new ();
   gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
 
   label = gtk_label_new(_("Class name:"));
   entry = gtk_entry_new();
   prop_dialog->classname = GTK_ENTRY(entry);
   gtk_widget_grab_focus(entry);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,0,1, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,0,1, GTK_FILL | GTK_EXPAND,0, 0,2);
+  
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
+  
+  gtk_widget_set_hexpand (label, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 0, 1, 1);
 
   label = gtk_label_new(_("Stereotype:"));
   entry = gtk_entry_new();
   prop_dialog->stereotype = GTK_ENTRY(entry);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,1,2, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,1,2, GTK_FILL | GTK_EXPAND,0, 0,2);
+
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
+  
+  gtk_widget_set_hexpand (label, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 1, 1, 1);
 
   label = gtk_label_new(_("Comment:"));
   scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
-  gtk_table_attach (GTK_TABLE (table), scrolledwindow, 1, 2, 2, 3,
-                   (GtkAttachOptions) (GTK_FILL),
-                   (GtkAttachOptions) (GTK_FILL), 0, 0);
+  gtk_grid_attach (GTK_GRID (table), scrolledwindow, 1, 2, 1, 1);
   gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow),
                                       GTK_SHADOW_IN);
   entry = gtk_text_view_new ();
@@ -352,7 +358,7 @@ class_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
   gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (entry), GTK_WRAP_WORD);
  
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,2,3, GTK_FILL,0, 0,0);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
   gtk_container_add (GTK_CONTAINER (scrolledwindow), entry);
 
   hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
@@ -446,46 +452,45 @@ style_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
   vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
   
-  table = gtk_table_new (5, 6, TRUE);
+  table = gtk_grid_new ();
   gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0);
-  gtk_table_set_homogeneous (GTK_TABLE (table), FALSE);
 
   /* head line */
   label = gtk_label_new (_("Kind"));
                                                     /* L, R, T, B */
-  gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
   label = gtk_label_new (_("Font"));
-  gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 0, 1);
+  gtk_grid_attach (GTK_GRID (table), label, 1, 0, 1, 1);
   label = gtk_label_new (_("Size"));
-  gtk_table_attach_defaults (GTK_TABLE (table), label, 2, 3, 0, 1);
+  gtk_grid_attach (GTK_GRID (table), label, 2, 0, 1, 1);
   
   /* property rows */
-  create_font_props_row (GTK_TABLE (table), _("Normal"), 1,
+  create_font_props_row (GTK_GRID (table), _("Normal"), 1,
                          umlclass->normal_font,
                          umlclass->font_height,
                          &(prop_dialog->normal_font),
                          &(prop_dialog->normal_font_height));
-  create_font_props_row (GTK_TABLE (table), _("Polymorphic"), 2,
+  create_font_props_row (GTK_GRID (table), _("Polymorphic"), 2,
                          umlclass->polymorphic_font,
                          umlclass->polymorphic_font_height,
                          &(prop_dialog->polymorphic_font),
                          &(prop_dialog->polymorphic_font_height));
-  create_font_props_row (GTK_TABLE (table), _("Abstract"), 3,
+  create_font_props_row (GTK_GRID (table), _("Abstract"), 3,
                          umlclass->abstract_font,
                          umlclass->abstract_font_height,
                          &(prop_dialog->abstract_font),
                          &(prop_dialog->abstract_font_height));
-  create_font_props_row (GTK_TABLE (table), _("Class Name"), 4,
+  create_font_props_row (GTK_GRID (table), _("Class Name"), 4,
                          umlclass->classname_font,
                          umlclass->classname_font_height,
                          &(prop_dialog->classname_font),
                          &(prop_dialog->classname_font_height));
-  create_font_props_row (GTK_TABLE (table), _("Abstract Class"), 5,
+  create_font_props_row (GTK_GRID (table), _("Abstract Class"), 5,
                          umlclass->abstract_classname_font,
                          umlclass->abstract_classname_font_height,
                          &(prop_dialog->abstract_classname_font),
                          &(prop_dialog->abstract_classname_font_height));
-  create_font_props_row (GTK_TABLE (table), _("Comment"), 6,
+  create_font_props_row (GTK_GRID (table), _("Comment"), 6,
                          umlclass->comment_font,
                          umlclass->comment_font_height,
                          &(prop_dialog->comment_font),
@@ -493,44 +498,61 @@ style_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
 
 
 
-  table = gtk_table_new (2, 4, TRUE);
+  table = gtk_grid_new ();
+  gtk_grid_set_row_homogeneous (GTK_GRID (table), TRUE);
+  gtk_grid_set_column_homogeneous (GTK_GRID (table), TRUE);
   gtk_box_pack_start (GTK_BOX (vbox),
                      table, FALSE, TRUE, 0);
   /* should probably be refactored too. */
   label = gtk_label_new(_("Line Width"));
-  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 2);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_widget_set_hexpand (label, TRUE);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
   adj = gtk_adjustment_new(umlclass->line_width, 0.0, G_MAXFLOAT, 0.1, 1.0, 0);
   line_width = gtk_spin_button_new (GTK_ADJUSTMENT(adj), 1.0, 2);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (line_width), TRUE);
   prop_dialog->line_width = GTK_SPIN_BUTTON(line_width);
-  gtk_table_attach (GTK_TABLE (table), line_width, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 3, 2);
+  gtk_widget_set_hexpand (line_width, TRUE);
+  gtk_grid_attach (GTK_GRID (table), line_width, 1, 0, 1, 1);
 
   label = gtk_label_new(_("Text Color"));
-  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, 0, 0, 2);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_widget_set_hexpand (label, TRUE);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
   text_color = dia_color_selector_new();
   dia_color_selector_set_use_alpha (text_color, TRUE);
   dia_color_selector_set_color(text_color, &umlclass->text_color);
   prop_dialog->text_color = (DiaColorSelector *)text_color;
-  gtk_table_attach (GTK_TABLE (table), text_color, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 3, 2);
+
+  gtk_widget_set_hexpand (text_color, TRUE);
+  gtk_grid_attach (GTK_GRID (table), text_color, 1, 1, 1, 1);
 
   label = gtk_label_new(_("Foreground Color"));
-  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, 0, 0, 2);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_widget_set_hexpand (label, TRUE);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
   line_color = dia_color_selector_new();
   dia_color_selector_set_use_alpha (line_color, TRUE);
   dia_color_selector_set_color(line_color, &umlclass->line_color);
   prop_dialog->line_color = (DiaColorSelector *)line_color;
-  gtk_table_attach (GTK_TABLE (table), line_color, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 3, 2);
+
+  gtk_widget_set_hexpand (line_color, TRUE);
+  gtk_grid_attach (GTK_GRID (table), line_color, 1, 2, 1, 1);
   
   label = gtk_label_new(_("Background Color"));
-  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, 0, 0, 2);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_widget_set_hexpand (label, TRUE);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1);
   fill_color = dia_color_selector_new();
   dia_color_selector_set_color(fill_color, &umlclass->fill_color);
   prop_dialog->fill_color = (DiaColorSelector *)fill_color;
-  gtk_table_attach (GTK_TABLE (table), fill_color, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 3, 2);
+
+  gtk_widget_set_hexpand (fill_color, TRUE);
+  gtk_grid_attach (GTK_GRID (table), fill_color, 1, 3, 1, 1);
 
   gtk_widget_show_all (vbox);
   gtk_widget_show (page_label);
diff --git a/objects/UML/class_operations_dialog.c b/objects/UML/class_operations_dialog.c
index bd10f70f..888bc719 100644
--- a/objects/UML/class_operations_dialog.c
+++ b/objects/UML/class_operations_dialog.c
@@ -769,8 +769,8 @@ operations_data_create_hbox (UMLClass *umlclass)
   vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 
   /* table containing operation 'name' up to 'query' and also the comment */
-  table = gtk_table_new (5, 3, FALSE);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 5);
+  table = gtk_grid_new ();
+  gtk_grid_set_column_spacing (GTK_GRID (table), 5);
   gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
 
   label = gtk_label_new(_("Name:"));
@@ -780,9 +780,13 @@ operations_data_create_hbox (UMLClass *umlclass)
                    G_CALLBACK (operations_update_event), umlclass);
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (operations_update), umlclass);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,0,1, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,0,1, GTK_FILL | GTK_EXPAND,0, 0,2);
+
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
+
+  gtk_widget_set_hexpand (entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 0, 1, 1);
 
   label = gtk_label_new(_("Type:"));
   entry = gtk_entry_new();
@@ -791,9 +795,14 @@ operations_data_create_hbox (UMLClass *umlclass)
                    G_CALLBACK (operations_update_event), umlclass);
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (operations_update), umlclass);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,1,2, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,1,2, GTK_FILL | GTK_EXPAND,0, 0,2);
+
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
+
+  gtk_widget_set_hexpand (entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 1, 1, 1);
+
 
   label = gtk_label_new(_("Stereotype:"));
   entry = gtk_entry_new();
@@ -802,9 +811,13 @@ operations_data_create_hbox (UMLClass *umlclass)
                    G_CALLBACK (operations_update_event), umlclass);
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (operations_update), umlclass);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,2,3, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,2,3, GTK_FILL | GTK_EXPAND,0, 0,2);
+
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
+
+  gtk_widget_set_hexpand (entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 2, 1, 1);
 
 
   label = gtk_label_new(_("Visibility:"));
@@ -817,10 +830,13 @@ operations_data_create_hbox (UMLClass *umlclass)
   dia_option_menu_add_item(omenu, _("Protected"), UML_PROTECTED);
   dia_option_menu_add_item(omenu, _("Implementation"), UML_IMPLEMENTATION);
 
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-                                       /* left, right, top, bottom */
-  gtk_table_attach (GTK_TABLE (table), label, 2,3,0,1, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), omenu, 3,4,0,1, GTK_FILL | GTK_EXPAND,0, 0,2);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 2, 0, 1, 1);
+
+  gtk_widget_set_hexpand (omenu, TRUE);
+  gtk_grid_attach (GTK_GRID (table), omenu, 3, 0, 1, 1);
+
   /* end: Visibility */
 
   label = gtk_label_new(_("Inheritance type:"));
@@ -832,17 +848,20 @@ operations_data_create_hbox (UMLClass *umlclass)
   dia_option_menu_add_item(omenu, _("Polymorphic (virtual)"), UML_POLYMORPHIC);
   dia_option_menu_add_item(omenu, _("Leaf (final)"), UML_LEAF);
 
-  gtk_table_attach (GTK_TABLE (table), label, 2,3,1,2, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), omenu, 3,4,1,2, GTK_FILL | GTK_EXPAND,0, 0,2);
+  gtk_grid_attach (GTK_GRID (table), label, 2, 1, 1, 1);
+
+  gtk_widget_set_hexpand (omenu, TRUE);
+  gtk_grid_attach (GTK_GRID (table), omenu, 3, 1, 1, 1);
+
   /* end: Inheritance type */
 
   checkbox = gtk_check_button_new_with_label(_("Class scope"));
   prop_dialog->op_class_scope = GTK_TOGGLE_BUTTON(checkbox);
-  gtk_table_attach (GTK_TABLE (table), checkbox, 2,3,2,3, GTK_FILL,0, 0,2);
+  gtk_grid_attach (GTK_GRID (table), checkbox, 2, 2, 1, 1);
 
   checkbox = gtk_check_button_new_with_label(_("Query"));
   prop_dialog->op_query = GTK_TOGGLE_BUTTON(checkbox);
-  gtk_table_attach (GTK_TABLE (table), checkbox, 3,4,2,3, GTK_FILL,0, 2,0);
+  gtk_grid_attach (GTK_GRID (table), checkbox, 3, 2, 1, 1);
 
   label = gtk_label_new(_("Comment:"));
   scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
@@ -859,8 +878,10 @@ operations_data_create_hbox (UMLClass *umlclass)
   g_signal_connect (G_OBJECT (entry), "focus_out_event",
                    G_CALLBACK (operations_update_event), umlclass);
 
-  gtk_table_attach (GTK_TABLE (table), label, 4,5,0,1, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), scrolledwindow, 4,5,1,3, GTK_FILL | GTK_EXPAND,0, 0,0);
+  gtk_grid_attach (GTK_GRID (table), label, 4, 0, 1, 1);
+
+  gtk_widget_set_hexpand (scrolledwindow, TRUE);
+  gtk_grid_attach (GTK_GRID (table), scrolledwindow, 4, 1, 1, 2);
   gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
 
   return hbox;  
@@ -970,8 +991,8 @@ operations_parameters_data_create_vbox (UMLClass *umlclass)
   gtk_widget_show(frame);
   gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0);
   
-  table = gtk_table_new (3, 4, FALSE);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 5);
+  table = gtk_grid_new ();
+  gtk_grid_set_column_spacing (GTK_GRID (table), 5);
   gtk_box_pack_start (GTK_BOX (vbox3), table, FALSE, FALSE, 0);
 
   label = gtk_label_new(_("Name:"));
@@ -981,9 +1002,13 @@ operations_parameters_data_create_vbox (UMLClass *umlclass)
                    G_CALLBACK (operations_update_event), umlclass);
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (operations_update), umlclass);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,0,1, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,0,1, GTK_FILL | GTK_EXPAND,0, 0,2);
+  
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
+  
+  gtk_widget_set_hexpand (entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 0, 1, 1);
 
   label = gtk_label_new(_("Type:"));
   entry = gtk_entry_new();
@@ -992,9 +1017,13 @@ operations_parameters_data_create_vbox (UMLClass *umlclass)
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (operations_update), umlclass);
   prop_dialog->param_type = GTK_ENTRY(entry);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,1,2, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,1,2, GTK_FILL | GTK_EXPAND,0, 0,2);
+
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
+
+  gtk_widget_set_hexpand (entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 1, 1, 1);
 
   label = gtk_label_new(_("Def. value:"));
   entry = gtk_entry_new();
@@ -1004,8 +1033,13 @@ operations_parameters_data_create_vbox (UMLClass *umlclass)
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (operations_update), umlclass);
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,2,3, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,2,3, GTK_FILL | GTK_EXPAND,0, 0,2);
+
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
+
+  gtk_widget_set_hexpand (entry, TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 2, 1, 1);
 
   label = gtk_label_new(_("Comment:"));
   scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
@@ -1023,9 +1057,12 @@ operations_parameters_data_create_vbox (UMLClass *umlclass)
   g_signal_connect (G_OBJECT (entry), "focus_out_event",
                    G_CALLBACK (operations_update_event), umlclass);
 
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 2,3,1,2, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), scrolledwindow, 3,4,1,3, GTK_FILL | GTK_EXPAND,0, 0,2);
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_grid_attach (GTK_GRID (table), label, 2, 1, 1, 1);
+
+  gtk_widget_set_hexpand (scrolledwindow, TRUE);
+  gtk_grid_attach (GTK_GRID (table), scrolledwindow, 3, 1, 1, 2);
 
   label = gtk_label_new(_("Direction:"));
 
@@ -1039,11 +1076,11 @@ operations_parameters_data_create_vbox (UMLClass *umlclass)
 
   { 
     GtkWidget * align;
-    align = gtk_alignment_new(0.0, 0.5, 0.0, 0.0);
-    gtk_container_add(GTK_CONTAINER(align), omenu);
+    align = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
+    gtk_container_add (GTK_CONTAINER (align), omenu);
     gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-    gtk_table_attach (GTK_TABLE (table), label, 2,3,0,1, GTK_FILL,0, 0,3);
-    gtk_table_attach (GTK_TABLE (table), align, 3,4,0,1, GTK_FILL,0, 0,3);
+    gtk_grid_attach (GTK_GRID (table), label, 2, 0, 1, 1);
+    gtk_grid_attach (GTK_GRID (table), align, 3, 0, 1, 1);
   }
 
   return vbox2;
diff --git a/objects/UML/class_templates_dialog.c b/objects/UML/class_templates_dialog.c
index 027a4a5a..5b4ea91e 100644
--- a/objects/UML/class_templates_dialog.c
+++ b/objects/UML/class_templates_dialog.c
@@ -428,7 +428,8 @@ _templates_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
   gtk_widget_show(frame);
   gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
 
-  table = gtk_table_new (2, 2, FALSE);
+  table = gtk_grid_new ();
+  gtk_grid_set_row_spacing (GTK_GRID (table), 2);
   gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
 
   label = gtk_label_new(_("Name:"));
@@ -438,9 +439,15 @@ _templates_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
                    G_CALLBACK (templates_update_event), umlclass); 
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (templates_update), umlclass); 
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,0,1, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,0,1, GTK_FILL | GTK_EXPAND,0, 0,2);
+
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_widget_set_halign (GTK_WIDGET (label), GTK_ALIGN_FILL);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
+
+  gtk_widget_set_halign (GTK_WIDGET (entry), GTK_ALIGN_FILL);
+  gtk_widget_set_hexpand (GTK_WIDGET (entry), TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 0, 1, 1);
 
   label = gtk_label_new(_("Type:"));
   entry = gtk_entry_new();
@@ -449,9 +456,16 @@ _templates_create_page(GtkNotebook *notebook,  UMLClass *umlclass)
                    G_CALLBACK (templates_update_event), umlclass);
   g_signal_connect (G_OBJECT (entry), "activate",
                    G_CALLBACK (templates_update), umlclass);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_table_attach (GTK_TABLE (table), label, 0,1,1,2, GTK_FILL,0, 0,0);
-  gtk_table_attach (GTK_TABLE (table), entry, 1,2,1,2, GTK_FILL | GTK_EXPAND,0, 0,2);
+
+  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+  gtk_label_set_yalign (GTK_LABEL (label), 0.5);
+  gtk_widget_set_halign (GTK_WIDGET (label), GTK_ALIGN_FILL);
+  gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1);
+
+  gtk_widget_set_halign (GTK_WIDGET (entry), GTK_ALIGN_FILL);
+  gtk_widget_set_hexpand (GTK_WIDGET (entry), TRUE);
+  gtk_grid_attach (GTK_GRID (table), entry, 1, 1, 1, 1);
+
 
   gtk_widget_show(vbox2);
   
diff --git a/plug-ins/postscript/paginate_psprint.c b/plug-ins/postscript/paginate_psprint.c
index a2b44123..38e72579 100644
--- a/plug-ins/postscript/paginate_psprint.c
+++ b/plug-ins/postscript/paginate_psprint.c
@@ -275,37 +275,39 @@ diagram_print_ps(DiagramData *dia, const gchar* original_filename)
   gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
   gtk_widget_show(frame);
 
-  table = gtk_table_new(2, 2, FALSE);
-  gtk_container_set_border_width(GTK_CONTAINER(table), 5);
-  gtk_table_set_row_spacings(GTK_TABLE(table), 5);
-  gtk_table_set_col_spacings(GTK_TABLE(table), 5);
-  gtk_container_add(GTK_CONTAINER(frame), table);
-  gtk_widget_show(table);
-
-  iscmd = gtk_radio_button_new_with_label(NULL, _("Printer"));
-  gtk_table_attach(GTK_TABLE(table), iscmd, 0,1, 0,1,
-                  GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
+  table = gtk_grid_new ();
+  gtk_container_set_border_width (GTK_CONTAINER (table), 5);
+  gtk_grid_set_row_spacing (GTK_GRID (table), 5);
+  gtk_grid_set_column_spacing (GTK_GRID (table), 5);
+  gtk_container_add (GTK_CONTAINER (frame), table);
+  gtk_widget_show (table);
+
+  iscmd = gtk_radio_button_new_with_label (NULL, _("Printer"));
+  gtk_widget_set_vexpand (iscmd, TRUE);
+  gtk_grid_attach (GTK_GRID (table), iscmd, 0, 0, 1, 1);
   gtk_widget_show(iscmd);
 
-  cmd = gtk_entry_new();
-  gtk_table_attach(GTK_TABLE(table), cmd, 1,2, 0,1,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(cmd);
+  cmd = gtk_entry_new ();
+  gtk_widget_set_vexpand (cmd, TRUE);
+  gtk_widget_set_hexpand (cmd, TRUE);
+  gtk_grid_attach (GTK_GRID (table), cmd, 1, 0, 1, 1);
+  gtk_widget_show (cmd);
 
   g_signal_connect(G_OBJECT(iscmd), "toggled",
                   G_CALLBACK(change_entry_state), cmd);
 
   isofile = gtk_radio_button_new_with_label(gtk_radio_button_get_group(GTK_RADIO_BUTTON(iscmd)),
                                            _("File"));
-  gtk_table_attach(GTK_TABLE(table), isofile, 0,1, 1,2,
-                  GTK_FILL, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(isofile);
-
-  ofile = gtk_entry_new();
-  gtk_widget_set_sensitive(ofile, FALSE);
-  gtk_table_attach(GTK_TABLE(table), ofile, 1,2, 1,2,
-                  GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
-  gtk_widget_show(ofile);
+  gtk_widget_set_vexpand (isofile, TRUE);
+  gtk_grid_attach(GTK_GRID (table), isofile, 0, 1, 1, 1);
+  gtk_widget_show (isofile);
+
+  ofile = gtk_entry_new ();
+  gtk_widget_set_sensitive (ofile, FALSE);
+  gtk_widget_set_vexpand (ofile, TRUE);
+  gtk_widget_set_hexpand (ofile, TRUE);
+  gtk_grid_attach (GTK_GRID (table), ofile, 1, 1, 1, 1);
+  gtk_widget_show (ofile);
   g_signal_connect(G_OBJECT(isofile), "toggled",
                   G_CALLBACK(change_entry_state), ofile);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]