[gtk+/parasite2] inspector: Add models to the tree
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/parasite2] inspector: Add models to the tree
- Date: Sat, 10 May 2014 16:31:15 +0000 (UTC)
commit e4da553c61833b537d98c413e493833e4ad6b8a5
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 9 22:49:31 2014 -0400
inspector: Add models to the tree
It makes sense to add the models of tree views, icon views
and combo boxes to the tree.
modules/inspector/widget-tree.c | 30 ++++++++++++++++++++++++++----
1 files changed, 26 insertions(+), 4 deletions(-)
---
diff --git a/modules/inspector/widget-tree.c b/modules/inspector/widget-tree.c
index 8518740..30553c3 100644
--- a/modules/inspector/widget-tree.c
+++ b/modules/inspector/widget-tree.c
@@ -297,16 +297,38 @@ gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
if (GTK_IS_TREE_VIEW (object))
{
gint n_columns, i;
- GObject *column;
+ GObject *child;
+
+ child = G_OBJECT (gtk_tree_view_get_model (GTK_TREE_VIEW (object)));
+ if (child)
+ gtk_inspector_widget_tree_append_object (wt, child, &iter, "model");
n_columns = gtk_tree_view_get_n_columns (GTK_TREE_VIEW (object));
for (i = 0; i < n_columns; i++)
{
- column = G_OBJECT (gtk_tree_view_get_column (GTK_TREE_VIEW (object), i));
- gtk_inspector_widget_tree_append_object (wt, column, &iter, NULL);
+ child = G_OBJECT (gtk_tree_view_get_column (GTK_TREE_VIEW (object), i));
+ gtk_inspector_widget_tree_append_object (wt, child, &iter, NULL);
}
}
+ if (GTK_IS_ICON_VIEW (object))
+ {
+ GObject *child;
+
+ child = G_OBJECT (gtk_icon_view_get_model (GTK_ICON_VIEW (object)));
+ if (child)
+ gtk_inspector_widget_tree_append_object (wt, child, &iter, "model");
+ }
+
+ if (GTK_IS_COMBO_BOX (object))
+ {
+ GObject *child;
+
+ child = G_OBJECT (gtk_combo_box_get_model (GTK_COMBO_BOX (object)));
+ if (child)
+ gtk_inspector_widget_tree_append_object (wt, child, &iter, "model");
+ }
+
if (GTK_IS_CELL_AREA (object))
{
FindAllData data;
@@ -322,7 +344,7 @@ gtk_inspector_widget_tree_append_object (GtkInspectorWidgetTree *wt,
GtkCellArea *area;
area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (object));
- gtk_inspector_widget_tree_append_object (wt, G_OBJECT (area), &iter, NULL);
+ gtk_inspector_widget_tree_append_object (wt, G_OBJECT (area), &iter, "cell-area");
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]