[glade/composite-templates-new: 1/6] GtkGrid fixed to work properly when adding widgets.



commit 76b84aae9c62e0a7a728ddfd0b15be418f9b951a
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sun Mar 31 18:19:47 2013 +0900

    GtkGrid fixed to work properly when adding widgets.
    
    I had broken the glade_widget_replace_child() implementation of GtkGrid
    in my last commit, this fixes it to properly introspect packing properties
    when initially dropping/adding a widget to a GtkGrid.

 plugins/gtk+/glade-gtk-grid.c |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-grid.c b/plugins/gtk+/glade-gtk-grid.c
index fbcc78d..916f41d 100644
--- a/plugins/gtk+/glade-gtk-grid.c
+++ b/plugins/gtk+/glade-gtk-grid.c
@@ -50,20 +50,12 @@ glade_gtk_grid_get_child_attachments (GtkWidget            *grid,
                                      GtkWidget            *child,
                                      GladeGridAttachments *grid_child)
 {
-  GladeWidget *gwidget = glade_widget_get_from_gobject (child);
-
-  /* gtk_container_child_get (GTK_CONTAINER (grid), child, */
-  /*                          "left-attach", &grid_child->left_attach, */
-  /*                          "width",       &grid_child->width, */
-  /*                          "top-attach",  &grid_child->top_attach, */
-  /*                          "height",      &grid_child->height, */
-  /*                      NULL); */
-
-  if (!glade_widget_pack_property_get (gwidget, "left-attach", &grid_child->left_attach) ||
-      !glade_widget_pack_property_get (gwidget, "top-attach", &grid_child->top_attach) ||
-      !glade_widget_pack_property_get (gwidget, "width", &grid_child->width) ||
-      !glade_widget_pack_property_get (gwidget, "height", &grid_child->height))
-    g_warning ("Failed to get grid child attachments");
+  gtk_container_child_get (GTK_CONTAINER (grid), child,
+                           "left-attach", &grid_child->left_attach,
+                           "width",       &grid_child->width,
+                           "top-attach",  &grid_child->top_attach,
+                           "height",      &grid_child->height,
+                          NULL);
 }
 
 static gboolean


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