[glom] Replace Gtk::Table with Gtk::Grid in the source code.



commit ba84b0a59730c504701766b12bc6b8d0559b9f45
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Oct 13 00:06:57 2011 +0200

    Replace Gtk::Table with Gtk::Grid in the source code.
    
    * glom/mode_design/fields/dialog_fielddefinition.h: Use the table
    (from the .glade file) via Gtk::Widget*.
    * ui/developer/window_print_layout_edit.glade: Replace the GtkTable
    with a GtkGrid.
    * glom/mode_design/print_layouts/window_print_layout_edit.cc:
    Adapt.
    There are still GtkTables in the other .glade files, but this at least
    lets us build with gtkmm 3.3/3.4 even with --enable-warnings=fatal.

 ChangeLog                                          |   13 +++++++++++++
 glom/mode_design/fields/dialog_fielddefinition.h   |    2 +-
 .../print_layouts/window_print_layout_edit.cc      |   17 +++++++++++------
 ui/developer/window_print_layout_edit.glade        |    8 +++-----
 4 files changed, 28 insertions(+), 12 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 15efe3e..540730a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-10-13  Murray Cumming  <murrayc murrayc com>
+
+	Replace Gtk::Table with Gtk::Grid in the source code.
+
+	* glom/mode_design/fields/dialog_fielddefinition.h: Use the table 
+	(from the .glade file) via Gtk::Widget*.
+	* ui/developer/window_print_layout_edit.glade: Replace the GtkTable
+	with a GtkGrid.
+	* glom/mode_design/print_layouts/window_print_layout_edit.cc:
+	Adapt.
+	There are still GtkTables in the other .glade files, but this at least
+	lets us build with gtkmm 3.3/3.4 even with --enable-warnings=fatal.
+
 2011-10-12  Murray Cumming  <murrayc murrayc com>
 
 	Print Layout: Avoid some code duplication.
diff --git a/glom/mode_design/fields/dialog_fielddefinition.h b/glom/mode_design/fields/dialog_fielddefinition.h
index 853cbe3..97f698e 100644
--- a/glom/mode_design/fields/dialog_fielddefinition.h
+++ b/glom/mode_design/fields/dialog_fielddefinition.h
@@ -78,7 +78,7 @@ private:
   Gtk::RadioButton* m_pRadio_UserEntry;
   Gtk::Alignment* m_pAlignment_UserEntry;
   Gtk::CheckButton* m_pCheck_Lookup;
-  Gtk::Table* m_pTable_Lookup;
+  Gtk::Widget* m_pTable_Lookup; //So we can make it insensitive.
   ComboBox_Relationship* m_pCombo_LookupRelationship;
   Combo_TextGlade* m_pCombo_LookupField;
 
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.cc b/glom/mode_design/print_layouts/window_print_layout_edit.cc
index 648a3e5..6056b07 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -113,12 +113,17 @@ Window_PrintLayout_Edit::Window_PrintLayout_Edit(BaseObjectType* cobject, const
     sigc::mem_fun(*this, &Window_PrintLayout_Edit::on_vruler_button_press_event), false);
  
   //Add the ruler widgets to the table at the left and top:
-  Gtk::Table* table = 0;
-  builder->get_widget("table_canvas", table);
-  gtk_table_attach(table->gobj(), GTK_WIDGET(m_vruler), 
-    0, 1, 1, 2, GTK_SHRINK, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
-  gtk_table_attach(table->gobj(), GTK_WIDGET(m_hruler), 
-    1, 2, 0, 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), GTK_SHRINK, 0, 0);
+  Gtk::Grid* grid = 0;
+  builder->get_widget("grid_canvas", grid);
+  gtk_grid_attach(grid->gobj(), GTK_WIDGET(m_vruler), 
+    0, 1, 1, 1);
+  gtk_widget_set_hexpand(GTK_WIDGET(m_vruler), FALSE);
+  gtk_widget_set_vexpand(GTK_WIDGET(m_vruler), TRUE);
+
+  gtk_grid_attach(grid->gobj(), GTK_WIDGET(m_hruler), 
+    1, 0, 1, 1);
+  gtk_widget_set_hexpand(GTK_WIDGET(m_hruler), TRUE);
+  gtk_widget_set_vexpand(GTK_WIDGET(m_hruler), FALSE);
 
   gimp_ruler_set_unit(m_hruler, GIMP_UNIT_MM);
   gimp_ruler_set_unit(m_vruler, GIMP_UNIT_MM);
diff --git a/ui/developer/window_print_layout_edit.glade b/ui/developer/window_print_layout_edit.glade
index e0948ee..66d10b2 100644
--- a/ui/developer/window_print_layout_edit.glade
+++ b/ui/developer/window_print_layout_edit.glade
@@ -108,12 +108,10 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkTable" id="table_canvas">
+                  <object class="GtkGrid" id="grid_canvas">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="n_rows">2</property>
-                    <property name="n_columns">2</property>
                     <child>
                       <object class="GtkVBox" id="vbox_canvas">
                         <property name="visible">True</property>
@@ -124,9 +122,9 @@
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
                         <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>



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