New function. Update screenshot window when rows are expanded and
authorSoeren Sandmann <sandmann@redhat.com>
Wed, 30 Nov 2005 07:12:32 +0000 (07:12 +0000)
committerSøren Sandmann Pedersen <ssp@src.gnome.org>
Wed, 30 Nov 2005 07:12:32 +0000 (07:12 +0000)
2005-11-29  Soeren Sandmann  <sandmann@redhat.com>

        * sysprof.c (on_descendants_row_expanded_or_collapsed): New
        function. Update screenshot window when rows are expanded and
        collapsed.

ChangeLog
sysprof.c

index b133934..0c144fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-11-29  Soeren Sandmann  <sandmann@redhat.com>
+
+       * sysprof.c (on_descendants_row_expanded_or_collapsed): New
+       function. Update screenshot window when rows are expanded and
+       collapsed.
+
 2005-11-23  Soeren Sandmann  <sandmann@redhat.com>
 
        * sysprof.c (update_screenshot_window): Update the screenshot
index c49bf05..1986696 100644 (file)
--- a/sysprof.c
+++ b/sysprof.c
@@ -1050,7 +1050,7 @@ compute_text_width (GtkTreeView  *view,
                    GtkTreeIter  *iter,
                    gpointer      data)
 {
-    int *width = data;
+   int *width = data;
     char *name;
 
     get_data (view, iter, &name, NULL, NULL);
@@ -1094,8 +1094,6 @@ set_monospace (GtkWidget *widget)
 static void
 update_screenshot_window (Application *app)
 {
-    typedef gboolean (* GtkTreeModelForeachFunc) (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
-
     /* FIXME: clear the text buffer here */
     
     if (app->descendants)
@@ -1124,6 +1122,16 @@ update_screenshot_window (Application *app)
 }
 
 static void
+on_descendants_row_expanded_or_collapsed (GtkTreeView *tree,
+                                         GtkTreeIter *iter,
+                                         GtkTreePath *path,
+                                         Application *app)
+{
+    update_screenshot_window (app);
+}
+                            
+
+static void
 on_object_selection_changed (GtkTreeSelection *selection,
                             gpointer          data)
 {
@@ -1434,6 +1442,10 @@ build_gui (Application *app)
     add_double_format_column (app->descendants_view, _("Cumulative"), DESCENDANTS_NON_RECURSE, "%.2f ");
     g_signal_connect (app->descendants_view, "row-activated",
                      G_CALLBACK (on_descendants_row_activated), app);
+    g_signal_connect (app->descendants_view, "row_expanded",
+                     G_CALLBACK (on_descendants_row_expanded_or_collapsed), app);
+    g_signal_connect (app->descendants_view, "row_collapsed",
+                     G_CALLBACK (on_descendants_row_expanded_or_collapsed), app);
     gtk_tree_view_column_set_expand (col, TRUE);
     
     gtk_widget_grab_focus (GTK_WIDGET (app->object_view));